Russia has freed WNBA star Brittney Griner in a dramatic high-level prisoner exchange, with the U.S. releasing notorious Russian arms dealer Viktor Bout.

The swap comes at a time of heightened tensions over Ukraine and it achieved a top goal for President Joe Biden.

But it also carried a heavy price, with American Paul Whelan still detained in Russia on espionage charges that his family and the U.S. government says baseless.

Biden says Griner is “safe, she’s on a plane, she’s on her way home.”

He spoke from the White House, where he was accompanied by Griner’s wife, Cherelle, and administration officials.

Griner's months-long imprisonment on drug charges brought unprecedented attention to the population of wrongful detainees.

The deal, the second such exchange in eight months with Russia, procured the release of the most prominent American detained abroad.

Biden's authorization to release a Russian felon once nicknamed “the Merchant of Death" underscored the escalating pressure that his administration faced to get Griner home, particularly after the recent resolution of her criminal case and her subsequent transfer to a penal colony.

“Moments ago I spoke to Brittney Griner. She is safe. She is on a plane. She is on her way home,” Biden tweeted.

The Russian Foreign Ministry also confirmed the swap, saying in a statement carried by Russian news agencies that the exchange took place in Abu-Dhabi and that Bout has been flown home.

Russian and U.S. officials had conveyed cautious optimism in recent weeks after months of strained negotiations, with Biden saying in November that he was hopeful that Russia would engage in a deal now that the midterm elections were completed. A top Russian official said last week that a deal was possible before year's end.

In releasing Bout, the U.S. freed a a former Soviet Army lieutenant colonel whom the Justice Department once described as one of the world's most prolific arms dealers. Bout, whose exploits inspired a Hollywood movie, was serving a 25-year sentence on charges that he conspired to sell tens of millions of dollars in weapons that U.S officials said were to be used against Americans.

The Biden administration was ultimately willing to exchange Bout if it meant Griner's freedom. The detention of one of the greatest players in WNBA history contributed to a swirl of unprecedented public attention for an individual detainee case — not to mention intense pressure on the White House.

Griner’s arrest in February made her the most high-profile American jailed abroad. Her status as an openly gay Black woman, locked up in a country where authorities have been hostile to the LBGTQ community, infused racial, gender and social dynamics into her legal saga and made each development a matter of international importance.

Her case not only brought unprecedented publicity to the dozens of Americans wrongfully detained by foreign governments, but it also emerged as a major inflection point in U.S.-Russia diplomacy at a time of deteriorating relations prompted by Moscow’s war against Ukraine.

Griner was arrested at the Moscow's Sheremetyevo Airport in February when customs officials said they found vape canisters with cannabis oil in her luggage. She pleaded guilty in July, though still faced trial because admitting guilt in Russia's judicial system does not automatically end a case.

She acknowledged in court that she possessed the canisters, but said she had no criminal intent and said their presence in her luggage was due to hasty packing.

(Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.)