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.
Griner was arrested at a Moscow airport in February for possessing cannabis oil and last month sent to a penal colony.
The Biden administration proposed a prisoner exchange last July, aware Moscow had long sought Bout's release.
Russia's foreign ministry confirmed the swap and said it had taken place at Abu Dhabi airport. "The Russian citizen has been returned to his homeland," it said in a statement, although he was not yet thought to have arrived on Russian soil.
Russian news agencies said he was still being flown to Vnukovo airport near Moscow.
Speaking in the Oval Office, Griner's wife Cherelle praised the efforts of the Biden administration in securing her release: "I'm just standing here overwhelmed with emotions." The ordeal had been one of the darkest moments of her life, she added.
A joint Saudi-UAE statement revealed that Saudi Crown Prince Mohammed bin Salman had taken 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.
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. But it became clear Whelan, jailed in 2018 on suspicion of spying, would not be part of the Russian swap, dashing the hopes of his family.
In the end President Biden signed the order for Bout's release, commuting his 25-year jail term, in a direct swap for Griner.
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 languishing 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".
In his tweet, President Biden posted a picture from the Oval Office alongside Griner's wife Cherelle.
"Moments ago I spoke to Brittney Griner. She is safe. She is on a plane. She is on her way home," he wrote. Shortly afterwards they both spoke publicly in statements carried live on US TV networks.
Secretary of State Antony Blinken singled out the efforts of presidential envoy Roger Carstens, who was accompanying 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.
Griner was moved last month to a penal colony in Mordovia, a remote area some 500km, (310m) south-east of Moscow. She had been held not far from where Paul Whelan is serving his 16-year jail term on spying charges he denied.
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."
President Biden urged Americans to take precautions before travelling overseas, and warned of the risk of being wrongfully detained by a foreign government.