Two US men who had been held as spies in Iran for more than two years have been released on bail from their Tehran jail.
Shane Bauer and Josh Fattal left Tehran's Evin prison on Wednesday, shortly after their lawyer Masoud Shafiei said he had completed the paperwork for their release.
"I have finished the job that I had to do as their lawyer,'' Shafiei said.
Immediately after their release, Bauer and Fattal left for Mehrabad airport, Iran's official IRNA news agency reported, and later flew to the Gulf state of Oman.
They arrived in Oman several hours later where their families were waiting to greet them.
At about 20 minutes before midnight Wednesday, Fattal and Bauer, wearing jeans and casual shirts, raced down the steps from the blue-and-white plane.
They made no statements to reporters before walking into the airport terminal building, which was guarded by security officials. The men appeared thin, but in good health.
"We're so happy we are free,'' Fattal told reporters in Oman. The two men made brief statements before leaving the airport with their families.
"Two years in prison is too long,'' Bauer said, and hoped their release from prison will also bring "freedom for political prisoners in America and Iran.''
"Best day of our lives"
Their families called it "the best day of our lives" and President Barack Obama said their release was "wonderful news."
"Today can only be described as the best day of our lives," said a statement from their families. "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."
"We now all want nothing more than to wrap Shane and Josh in our arms, catch up on two lost years and make a new beginning, for them and for all of us," the statement added.
Obama called it "wonderful, wonderful news about the hikers, we are thrilled...It's a wonderful day for them and for us."
The Swiss ambassador to Tehran and a delegation from Oman were present when the two American prisoners were freed.
The men were released into the custody of the Swiss embassy, as Washington has no diplomatic relations with Tehran and its interests are looked after by the Swiss.
Oman, a US Gulf ally which has good relations with Iran, agreed to pay the two men's bail of $1m, $500,000 for each.
Obama expressed gratitude to several foreign officials for their help.
"We are deeply grateful to His Majesty Sultan Qaboos bin Said of Oman, Iraqi President Jalal Talabani, the Swiss government, and to all our partners and allies around the world who have worked steadfastly over the past two years to secure the release of Shane and Josh," his statement said.
Fattal and Bauer were arrested in July 2009 near Iran's border with Iraq, and sentenced last month to eight years in prison on charges of spying for the US and illegally entering Iran.
A third person with whom they were arrested, Sarah Shourd, was freed in September 2010 on a $500,000 bail payment.
The three US citizens have denied the charges of spying and repeatedly said they were hiking in the area when they were detained.
Their families and the US government also said they were hiking in northern Iraq's Kurdish region when they may have accidentally strayed over the unmarked border with Iran.
Iranians in US jails
The affair heightened tensions between Tehran and Washington, which severed diplomatic ties after the storming of the US embassy in the wake of the 1979 Islamic Revolution.
Mohammad Marandi, professor of political science at the University of Tehran, told Al Jazeera that the US citizens were "treated quite well" while many Iranians are held in solitary confinement in the US for a variety of reasons.
"The Iranians have many of their people in American prisons," Marandi said.
"There are a number of Iranians that have been put in jail in solitary confinement in the US for doing trade with Iran; there are others that have been put in jail on charges that are completely baseless.
"There is a great deal of suspicion about the Americans in Iran. The Iranians believe they were spies.
"If three Iranians were arrested crossing into the United States from the Mexican border ... and the Americans had captured them, do you think the Americans would release them if the Iranians demanded their release?"
Source: Al Jazeera and agencies