Five Americans jailed for years in Iran and widely regarded as hostages are on their way home to the United States.
The last pieces in a controversial swap mediated by Qatar fell into place when $6bn (£4.8bn) of Iranian funds held in South Korea reached banks in Doha.
It triggered the departure of the four men and one woman in Tehran, who are also Iranian citizens, on a chartered flight to Qatar's capital.
They were met by senior US officials and are now on their way to Washington.
The Americans include 51-year-old businessman Siamak Namazi, who has spent nearly eight years in Tehran's notorious Evin prison, as well as businessman Emad Shargi, 59, and environmentalist Morad Tahbaz, 67, who also holds British nationality.
The US has said its citizens were imprisoned on baseless charges for political leverage.
In the first indication a deal was reached, they were moved in mid-August from Evin to a safe house in Tehran.
Five Iranians imprisoned in US jails, mainly on charges of violating US sanctions, are also being granted clemency as part of this swap. Not all of them are expected to return to Iran.
They have been named by Iran as Reza Sarhangpour, Kambiz Attar Kashani, Kaveh Lotfolah Afrasiabi, Mehrdad Moein Ansari and Amin Hasanzadeh.
"Today, five innocent Americans who were imprisoned in Iran are finally coming home," US President Joe Biden said after their plane landed in Doha.
He said all five had endured "years of agony, uncertainty, and suffering."
Mr Biden also announced fresh US sanctions targeting the former Iranian president Mahmoud Ahmadinejad and the Iranian Ministry of Intelligence for what he said was their involvement in wrongful detentions.
Siamak Namazi said in a statement: "I would not be free today if it wasn't for all of you who didn't allow the world to forget me.
"From the bottom of my heart, thank you. Thank you for being my voice when I could not speak for myself and for making sure I was heard when I mustered the strength to scream from behind the impenetrable walls of Evin Prison."
He also praised President Biden for making "some incredibly difficult decisions to rescue us" and "ultimately putting the lives of American citizens above politics".
The deal comes after months of indirect talks mediated by Qatar, which began in February last year.
A source said that there were at least nine rounds of discussions in Doha. Senior Qatari officials also shuttled between Tehran and Washington.
"I think there's a little bit of a win for both sides," Iranian-born Professor Mehran Kamrava, who now teaches at Georgetown University in Qatar, told the BBC.
"For Biden, heading into the election, he's bringing Americans home and for Iran, there's the release of Iranians in prison in the United States, but it's that six billion [dollars] that's a big win."
Iranian officials have repeatedly declared they will spend their money as they wish. However, sources involved in this process insist these funds will be strictly controlled.
"No funds will go into Iran," they emphasised. "Only humanitarian transactions, including food, medicine, agriculture, paid to third party vendors, transaction by transaction."
Sources told the BBC this money was not part of Iranian assets frozen by sanctions. The money in South Korea, revenue from Iranian oil sales, had been available to Tehran for bilateral and non-sanctioned aid but was not spent for various reasons including difficulties of currency conversion.
Leading US Republicans have denounced the deal as a ransom payment and sanctions relief. The Republican chairman of the House Foreign Affairs Committee, Michael McCaul, castigated the US government for transferring funds to "the world's top state sponsor of terrorism".
Latest Stories
-
Duct-taped banana artwork sells for $6.2m in NYC
23 mins -
Arrest warrants issued for Netanyahu, Gallant and Hamas commander over alleged war crimes
27 mins -
Actors Jonathan Majors and Meagan Good are engaged
32 mins -
Expired rice saga: A ‘best before date’ can be extended – Food and Agriculture Engineer
40 mins -
Why I rejected Range Rover gift from a man – Tiwa Savage
41 mins -
KNUST Engineering College honours Telecel Ghana CEO at Alumni Excellence Awards
1 hour -
Postecoglou backs Bentancur appeal after ‘mistake’
1 hour -
#Manifesto debate: NDC to enact and pass National Climate Law – Prof Klutse
2 hours -
‘Everything a manager could wish for’ – Guardiola signs new deal
2 hours -
TEWU suspends strike after NLC directive, urges swift resolution of grievances
2 hours -
Netflix debuts Grain Media’s explosive film
2 hours -
‘Expired’ rice scandal: FDA is complicit; top officials must be fired – Ablakwa
3 hours -
#TheManifestoDebate: We’ll provide potable water, expand water distribution network – NDC
3 hours -
IPR Ghana@50: Pupils educated to keep the environment clean
3 hours -
PenTrust CEO named ‘Best Pensions CEO’, company wins ‘Scheme Administrator Award’ at Ghana Accountancy & Finance Awards 2024
4 hours