US basketball player Brittney Griner, sentenced to nine years in prison in Russia, has been released in a prisoner swap.

It was exchanged for the Russian arms dealer Viktor Bout (also But), who was arrested in the United States, at Abu Dhabi airport, as the Russian Foreign Ministry announced in Moscow on Thursday.

The negotiations had been going on for months.

Russia and the US have exchanged prisoners in the past, despite tensions over Russia's war of aggression in Ukraine.

In August, a Russian court sentenced Griner to nine years in a camp for drug possession in a trial heavily criticized by the United States.

Most recently, she was transferred to a women's prison in the Russian republic of Mordovia in the greater Volga region.

From the beginning there was hope that the 32-year-old could be released if prisoners were exchanged.

According to the judiciary, the athlete had so-called vape cartridges and hashish oil with her during a baggage check at Moscow's Sheremetyevo Airport.

It is said to have been 0.5 grams.

This was ruled as illegal drug possession and attempted smuggling.

The court saw no mitigating circumstances.

Griner had pleaded guilty.

Right from the start, Washington had accused Moscow of a politically motivated trial – above all because of the high sentence.

A higher court dismissed Griner's appeal in October.

Griner has played for the top Russian club UMMC Yekaterinburg in the Urals since 2015 and won the Euroleague four times with them.

In the American women's professional league WNBA she won the championship with the Phoenix Mercury in 2014, with the US national team she won two gold medals at the world championships in addition to two Olympic victories.

In return, Russia received the former Soviet officer Viktor Bout.

It was said in Moscow that he was on his way to Russia on a plane.

He is said to have illegally equipped criminal regimes and rebels in numerous countries with weapons.

The Russian, notorious as the "Dealer of Death", was imprisoned as an arms dealer in the USA.

The White House said it had made several diplomatic attempts to get the basketball player released.

"She's safe.

She's on an airplane.

She's on her way home," US President Joe Biden wrote on Twitter.

He just spoke to her.

The US President published two photos.

On one he is said to be on the phone with Griner, on the other he is holding her wife Cherelle Griner in his arms.

Vice President Kamala Harris can also be seen in the pictures.

The White House said Biden would address the public shortly.