WASHINGTON (AP) — The worst possible moment for bringing Trevor Reed home turned out to be the best.

With U.S.-Russian relations at their lowest point in decades, it seemed an improbable time to hope for the release of Reed, a former Marine detained in Russia for almost three years. Yet this week the Biden administration completed the type of transaction it had earlier seemed resistant to, exchanging Reed for Konstantin Yaroshenko, a Russian pilot and convicted drug trafficker serving a 20-year prison sentence in Connecticut.

A series of events and considerations in the last two months helped facilitate the swap, including escalating concerns over Reed’s health, a private Oval Office meeting between his parents and President Joe Biden and a secretive Moscow trip by a former diplomat on the cusp of Russia’s war with Ukraine.

“All those three forced the White House to make a decision that they hadn’t made before,” said Mickey Bergman, vice president at the Richardson Center for Global Engagement.

How the war — and the breakdown in U.S.-Russian relations — affected the deal isn’t clear. U.S. officials stressed that the negotiations for Reed’s release were narrow in scope, focused squarely on the prisoners and not on Russia’s war and not reflective of any broader diplomatic engagement. But while the timing of the deal was startling, it’s also clear that the groundwork for it had been laid before the conflict had begun.

“I did it,” Biden told reporters Wednesday about the deal. “I raised it. I raised it three months ago.”

Just as the war was about to commence, Bergman and his colleague, Bill Richardson, a former U.S. ambassador to the United Nations and ex-New Mexico governor, flew to Moscow on the plane of FedEx chief executive Fred Smith for a meeting with Russian government officials. It was a continuation of negotiations they’d been having for the release of Reed and another jailed American, corporate security executive Paul Whelan.

They left with the contours in place for the one-for-one swap that ultimately took place.

In Texas, Joey and Paula Reed were worrying that Russia’s war with Ukraine, and resulting tensions with the U.S., could close off communication channels and prevent any common ground for negotiations. During meetings with administration officials in the last year — including with the Justice Department, which prosecuted Yaroshenko — the couple expressed support for a swap but say they weren’t led to think that was a viable option.

“They didn’t say: ‘Oh, we agree with you, that’s a great deal. That’s a good point,'” Paula Reed said in a February interview with The Associated Press. “They didn’t say anything like that. They just said: ‘We hear you. Thank you very much.’”

But weeks into the war, the couple did something that got the White House’s attention.

As Biden traveled to Texas to support veterans, the Reeds stood along the motorcade route in hopes of getting meaningful face-time with the president. That didn’t happen, though he did speak by phone with the couple. Later that month, they arrived in Washington and stood with signs near the White House, hoping again to meet with the president.

This time, they were invited into the Oval Office for a sit-down with Biden and other administration officials. The White House issued a statement that night reiterating its commitment to getting Reed and Whelan home, an issue that senior officials had raised in private meetings with Russian leaders.

The meeting was a rare bit of presidential access for the family of an American detainee, especially since Biden himself has been less public than his predecessor, Donald Trump, about efforts to get Americans home. Behind the scenes, though, Biden and Secretary of State Antony Blinken were raising the cases with the Russians, and Roger Carstens, the special presidential envoy for hostage affairs, was working on the issue too.

Hovering in the background was Reed’s health. In March, Reed told his parents he’d been coughing up blood several times a day, had pain in his lung and a broken rib. Last year, he contracted COVID-19. Even on Wednesday, his parents were taken aback by how thin their son looked during video footage of the transfer. They said they expected that he’d need medical care before resuming his daily life in Texas.

Paula Reed told ABC’s “Good Morning America” that Trevor was getting testing done, and his sister, Taylor, said that his “spirits are bright.”

“He’s telling stories,” she said. “He’s flirting with the nurse staff. It’s great. It’s great to see.”

His health issues also alarmed U.S. officials.

“That, I think, contributed to really ratcheting up the conversations on this issue, getting to a point where we were able to make this arrangement, getting to a point where we were able to turn to some of the logistics of simply getting it done,” a senior administration official told reporters in a background briefing this week.

Separately, a lawyer for Yaroshenko has said his client also suffered from multiple health problems and had earlier tried unsuccessfully to have him freed early from prison on compassionate release grounds because of the pandemic.

Left out of any deal were Whelan, who is serving a 16-year sentence on espionage-related charges that his family says are fabricated, and Brittney Griner, a WNBA star detained in February after Russian authorities said a search of her bag revealed a cannabis derivative.

The Whelan family said in a statement that it was happy about Reed’s release but troubled that their loved one wasn’t part of it.

“Paul has already spent 3 and a quarter years as a Russian hostage,” the statement said. “Is President Biden’s failure to bring Paul home an admission that some cases are too hard to solve? Is the Administration’s piecemeal approach picking low-hanging fruit?”

Richardson, who has helped facilitate multiple releases of American detainees and hostages in recent years, said the Biden team deserves recognition for authorizing this particular swap at a time when U.S.-Russia relations were so low.

“It doesn’t matter who gets credit,” Richardson said, “as long as hostages like Trevor Reed are home.”

____

Follow Eric Tucker on Twitter at http://www.twitter.etuckerAP