The US and Russia have exchanged jailed US basketball star Brittney Griner for notorious arms dealer Viktor Bout, held in an American prison for 12 years.
President Joe Biden said Griner was safe and on a plane home from the United Arab Emirates.
"I'm glad to say Brittney's in good spirits... she needs time and space to recover," he said at the White House.
Bout - widely known as the "merchant of death" - has arrived back in Moscow, Russian media reports.
"In the middle of the night they simply woke me up and said 'Get your things together' and that was it," Bout said in brief remarks to a reporter from national television, after landing in Russia.
Bout reportedly came down the aeroplane steps carrying a bouquet of flowers before embracing his mother and his wife.
Griner was arrested at a Moscow airport in February for possessing cannabis oil and last month she was sent to a penal colony.
The Biden administration proposed a prisoner exchange in July, aware Moscow had long sought Bout's release.
The elaborate swap involved two private planes bringing the pair to Abu Dhabi airport from Moscow and Washington, and then flying them home.
Footage on Russian state media showed them crossing on the tarmac with their respective teams. In the video, apparently provided by Russian security services, Bout is warmly greeted by two Russian officials as Griner, who is 6ft 9in (206cm), looks on. Part of the swap is then edited out before the two parties go their separate ways.
"The Russian citizen has been returned to his homeland," the Russian foreign ministry said in a statement.
Speaking in the Oval Office, Brittney Griner's wife Cherelle praised the efforts of the Biden administration in securing her release: "I'm just standing here overwhelmed with emotions."
According to a joint Saudi-UAE statement, Saudi Crown Prince Mohammed bin Salman played a leading role in mediation efforts, along with UAE President Mohammed bin Zayed al-Nahyan.
The heir to the Saudi throne has good relations with Russia's Vladimir Putin and in September he helped co-ordinate a complex swap of hundreds of prisoners held by Russia and Ukraine.
But the White House denied any mediation had been involved. "The only countries that negotiated this deal were the United States and Russia," said press secretary Karine Jean-Pierre.
When negotiations began to secure Griner's release during the summer, the US made clear it wanted ex-marine Paul Whelan to be included in an exchange.
Bout's lawyer, Alexei Tarasov, told Russian TV that from the start the US wanted two of its citizens returned, and Russia's foreign ministry complained that "Washington categorically refused to engage in dialogue".
But it became clear that Whelan, jailed in 2018 on suspicion of spying, would not be part of the Russian swap, dashing his family's hopes.
Paul Whelan told CNN he was "greatly disappointed" more had not been done to free him, as he had carried out no crime: "I don't understand why I'm still sitting here," he said.
President Biden finally signed the order for Bout's release, commuting his 25-year jail term, in a direct swap for Griner.
Bout's wife Alla told Russian TV she had spoken to him only two days ago: "He was supposed to call me tonight. Now we'll see each other and hug each other. That's better than any phone call."
Viktor Bout sold arms to warlords and rogue governments, becoming one of the world's most wanted men.
Dubbed the "merchant of death" for gun-running in the years after the fall of the Soviet Union, the Russian's exploits inspired the 2005 Hollywood film Lord of War, which was loosely based on his life.
His secretive career was brought to an end by an elaborate US sting in 2008, when he was arrested at a hotel in the Thai capital Bangkok, to the anger of the Russian government.
He was extradited two years later and has spent the past 12 years in an American jail for conspiring to support terrorists and kill Americans.
Bout's circumstances could hardly be more different from that of his opposite number in the prisoner swap.
Brittney Griner, 32, is one of the best-known sportswomen in America. During the US basketball season the double Olympic champion is a star centre for Phoenix Mercury in the WNBA.
Her only reason for flying to Moscow was to play in Russia during the off-season in the US. She told her Russian trial that the cannabis oil found in her bag had been an "honest mistake".
Secretary of State Antony Blinken singled out the efforts of presidential envoy Roger Carstens, who accompanied Griner on the plane from the UAE.
Leading figures in US basketball welcomed her release, among them twice WNBA champion Breanna Stewart of the Seattle Storm.
BG is FREE!!! 294 days and she is coming home!!! 😭🤍🙏🏻❤️— Breanna Stewart (@breannastewart) December 8, 2022
Griner was moved last month to a penal colony in Mordovia, a remote area some 500km, (310m) south-east of Moscow. She was held not far from where Paul Whelan is serving his 16-year jail term on spying charges.
In his statement President Biden said Russia had treated Whelan's case differently from Griner's for totally illegitimate reasons.
"While we have not yet succeeded in securing Paul's release we have not given up; we will not give up," he vowed.
Whelan's brother, David, praised Griner's release and said US officials had warned the family in advance that Paul Whelan was not part of the exchange.
"It's clear the US government needs to be more assertive," he said in a statement. "If bad actors like Russia are going to grab innocent Americans, the US needs a swifter, more direct response."
Former White House national security advisor John Bolton condemned the deal as a not a swap but a surrender by the Biden administration.
"Terrorists and rogue states all around the world will take note of this and it endangers other Americans in the future," he said.
The deal was also criticised by Robert Zachariasiewicz, a former agent with the US Drug Enforcement Administration, who helped lead the team that arrested Viktor Bout.
"Today's actions just placed a target on back of every United States citizen travelling throughout the world and they just became a commodity," he told the BBC's World Tonight.
"I think we just sent the message that it's really good business to illegally detain and if not kidnap American citizens, and it's really great to have one in your back pocket if you need them for a trade at some point."
Vladimir Osechkin - a former Russian MP who led a parliamentary investigation into Bout, and who is now a dissident in France - told the BBC's Outside Source programme he believed Vladimir Putin wanted Bout back because of what he knew.
"Putin and the generals were worried that Viktor Bout might start providing detailed and consistent evidence of what he knew about Russian intelligence helping terrorist organisations and organising sabotage abroad," he said.
"It was a matter of honour for them to take their agent back."
However, the US Bring Our Families Home Campaign suggested Russians saw Bout in a very different light. "Over the years they built him up like the spy of the century. There's a domestic political problem in Russia to keep the lie going," said Jonathan Franks from the campaign.
Thursday's prisoner exchange is not the first between Russia and the US this year. US marine Trevor Reed spent three years in jail for assault before being traded last April for Konstantin Yaroshenko, a Russian pilot convicted of smuggling cocaine.
Speaking from a Russian penal colony, Paul Whelan said he had been told that Russia "put me at a level higher than what they did with Trevor and Brittney", because he had been accused of spying.
President Biden urged Americans to take precautions before travelling overseas, and warned of the risk of being wrongfully detained by a foreign government.