Shane Bauer and Sarah Shourd become formally engaged in Oman on Friday.

Story highlights

NEW: Obama calls the Omani sultan to thank him for "sparing no effort"

The formal engagement ceremony was in Muscat, Oman

When they were in prison, Bauer made a ring out of threads from a shirt

Shourd lost the makeshift ring while working for Bauer's release

CNN  — 

Shane Bauer and Sarah Shourd, two of the three Americans hikers who had been held by Iran over the past two years, were formally engaged in Oman on Friday, an envoy of the sultan said.

Salem al-Ismaily, the envoy of Sultan Qaboos bin Said, said the event occurred in a “private function” at the Al Bustan Palace Hotel in the Omani capital of Muscat before family members and others, including him and the U.S. ambassador, Richard Schmierer.

Shourd, in an interview with CNN a year ago, said Bauer had asked her to marry him while they were imprisoned so that they could have something to sustain them through their days in Evin Prison, and give them hope for their future together.

American hiker Shane Bauer, left, is embraced by fiancee Sarah Shourd after his release from Iran on Wednesday.

Bauer and Shourd told their families in May last year that they had gotten engaged in prison and planned to get married after their release. Josh Fattal, the third hiker, plans to be best man at the wedding, the hikers’ relatives said in a statement at the time.

When they were in prison, Bauer made a ring out of threads from a shirt and gave it to Shourd. But Shourd lost the makeshift ring while traveling around the United States working for the release of Bauer and Fattal.

CNN obtained a picture of Bauer putting a ring on the finger of a beaming Shourd at the event Friday.

Also Friday, U.S. President Barack Obama called Said “to convey the United States’ deepest appreciation for the sultan’s exceptional and successful role” securing the two hikers’ release, according to a statement from the White House.

“The president expressed our gratitude for (Omani leaders) sparing no effort to secure the release … thus ending a painful chapter for the hikers and their families,” the statement said. “The friendship and partnership between our two nations, as manifested in our cooperation for the release of the hikers, have only grown stronger.”

Fattal and Bauer were released Wednesday from the Iranian jail and were flown to Muscat, where Shourd and their families greeted them with elation.

“We’re so happy we are free and so relieved we are free,” Fattal said. “Our deepest gratitude goes toward his majesty Sultan Qaboos of Oman for obtaining our release. We’re sincerely grateful for the government of Oman for hosting us and our families.”

Bauer said: “Two years in prison is too long and we sincerely hope for the freedom of other political prisoners and other unjustly imprisoned people in America and Iran.”

The families earlier expressed their joy, relief and gratitude at the pair’s release.

“Today can only be described as the best day of our lives,” they said in a statement. “We have waited for nearly 26 months for this moment and the joy and relief we feel at Shane and Josh’s long-awaited freedom knows no bounds.

Fattal and Bauer were arrested and charged as spies along with Shourd in July 2009 after apparently straying over an unmarked border between Iraqi Kurdistan and Iran.

The Americans say they accidentally crossed into Iran when they veered off a dirt road while hiking near a tourist site in the Kurdish region of northern Iraq. They denied the charges and appealed the sentence while serving time in prison.

Shourd was freed almost exactly a year ago on medical grounds. Her release came a week before Iranian President Mahmoud Ahmadinejad addressed the United Nations last year. Fattal and Bauer were released a day before his address this year.

Bauer and Fattal, both 29, were convicted last month of entering Iran illegally and spying for the United States, and each was sentenced to eight years in prison.

But Fattal and Bauer were released on bail of $500,000 each and their sentences for spying convictions were commuted, Iran’s judiciary said, according to government-run Press TV. The departure of the two from Iran effectively meant the bail money will be forfeited and kept by Iran.

The lawyer for Fattal and Bauer, Masoud Shafiee, told CNN the $1 million bail had been paid by the Omani government.

CNN’s Victoria Brown contributed to this report