WASHINGTON, April 27 (Reuters) - The United States and Russia swapped prisoners on Wednesday amid their most tense relations in decades over the war in Ukraine, with former U.S. Marine Trevor Reed released in exchange for Russian pilot Konstantin Yaroshenko.

The swap was not part of broader diplomatic talks and did not represent an American change in approach on Ukraine, U.S. officials said. Russian-American ties have been at their worst since the Cold War era following Russia's Feb. 24 invasion of Ukraine and subsequent Western sanctions imposed on Moscow.

Reed, from Texas, was expected to arrive back in the United States on Wednesday night, State Department spokesperson Ned Price said. Senior U.S. officials said the 30-year-old was in "good spirits."

"Today, we welcome home Trevor Reed and celebrate his return to the family that missed him dearly," President Joe Biden said in a statement, noting the parents' concerns about their son's health.

"The negotiations that allowed us to bring Trevor home required difficult decisions that I do not take lightly," Biden added.

Asked later on Wednesday how he was able to raise the issue of Reed's detention amid the broader tensions with Russia over Ukraine, Biden said, "I did it. I raised it. I raised it three months ago."

Reed was convicted in Russia in 2019 of endangering the lives of two police officers while drunk on a visit to Moscow. The United States called his trial a "theater of the absurd."

U.S. officials said Biden commuted the sentence of Yaroshenko, a Russian pilot who was arrested by American special forces in Liberia in 2010 and convicted for conspiracy to smuggle cocaine into the United States. Russia had proposed a prisoner swap for Yaroshenko in July 2019 in exchange for the release of any American.

The swap occurred in Turkey, and the United States thanked Turkey, a NATO ally, for its help in the exchange. Russian news agencies reported that Yaroshenko then flew from Ankara to Sochi and finally to Moscow. Rossiya 1, Russia's main national news channel, showed video of Yaroshenko's being embraced by his wife and his daughter, who was jumping up and down with joy, on the tarmac at a Moscow airport.

Biden and Secretary of State Antony Blinken said they were working to free another American held in Russia, Paul Whelan, also a former Marine.