An American scholar held for three years on espionage charges in Iran has been released from prison and was flown out of the country in exchange for an Iranian biologist imprisoned in the United States, officials said early Saturday.

Xiyue Wang, a Princeton University graduate student, was conducting research in Iran when he was arrested in 2016. He was sentenced to 10 years in prison the following year and sent to the notorious Evin prison in Tehran.

Wang was exchanged for Massoud Soleimani, a stem cell researcher arrested last year on charges of sanctions violations. He was scheduled to appear in court on Dec. 11, but the Justice Department dropped all charges against him, paving the way for his release.

After the exchange was made in Switzerland, Wang was flown to a U.S. air base in Ramstein, Germany, where U.S. physicians will examine him, a senior administration official said. Another official who spoke with Wang by telephone said he sounded in good health and spirits.

The prisoner swap represented a striking breakthrough in a time of spiraling tensions between Tehran and Washington. In a background briefing call with reporters, the second senior administration official reiterated President Trump’s offer to negotiate with Iran with no preconditions to discuss a range of issues. Among them are the abolition of Iran’s nuclear program, the release of all American prisoners, and an end to Iran’s support for militias and rebels in other countries in the region.

“We’re hopeful that the release of Mr. Wang is a sign the Iranians may be willing to come to the table to discuss all the issues,” he said, speaking on the condition of anonymity under White House rules.

Secretary of State Mike Pompeo expressed hope that Wang’s release may presage the release of several other Americans imprisoned on charges the United States considers baseless.

“We will not rest until we bring every American detained in Iran and around the world back home to their loved ones,” he tweeted. “We thank the Swiss government for facilitating the return of Mr. Wang, and are pleased the Iranian government has been constructive in this matter.”

Negotiations between Iran and the United States, which do not have diplomatic relations, were mediated by the Swiss Embassy in Tehran. Switzerland represents U.S. interests in Iran.

Talks for Wang’s release began under Robert C. O’Brien, the State Department’s former hostage envoy. Brian Hook, the special envoy for Iran, took over after O’Brien left for the White House to become national security adviser. U.S. officials said the talks picked up momentum in the last three or four weeks.

Hook left Washington on Friday night to oversee the handover in Switzerland and accompanied Wang to Germany.

Iranian Foreign Minister Mohammad Javad Zarif confirmed that Soleimani was released in the exchange and flew to Switzerland to take him back to Iran. Soleimani was arrested in 2018 when he arrived in Chicago en route to a visiting scholar position at the Mayo Clinic in Minnesota.

“Glad that Professor Massoud Soleimani and Mr. Xiyue Wang will be joining their families shortly. Many thanks to all engaged, particularly the Swiss government,” he said in a tweet.

Zarif later tweeted photos of Soleimani standing with him beside their plane and onboard en route to Tehran.

Wang’s wife, Hua Qu, expressed gratitude “to everyone who helped make this happen.”

“Our family is complete once again. Our son Shaofan and I have waited three long years for this day and it’s hard to express in words how excited we are to be reunited with Xiyue,” she said in a statement released through her lawyer.

U.S. officials were jubilant over Wang’s release and the fact it did not require a policy change or cash. Trump has criticized the 2015 Iran nuclear deal, which coincided with a prisoner swap that obtained the release of five Americans, including Washington Post journalist Jason Rezaian. Pompeo has complained about the “pallets of cash” that were paid to Iran in a lawsuit settlement that returned money to Iran that was frozen in U.S. banks after the 1979 revolution.

“There was no sanctions relief, no pallets of cash and no change in policy,” the first administration official said.

Iran has been floating proposals for a prisoner swap for almost a year now. But it has come under increased pressure in recent weeks, as anti-government protests have convulsed the country and thousands of protesters have been arrested, leading to more overcrowding in jails and early releases for some prisoners.

The Europeans, who continue to support the nuclear deal despite a U.S. withdrawal under Trump, have turned harshly critical of Iran in light of the protests, increased missile testing and a gradual retreat from its commitments under the agreement since the United States reimposed sanctions that have devastated the economy.

Wang’s imprisonment had drawn worldwide attention. In May, a group of U.N. experts called his detention arbitrary and a violation of fundamental rights guaranteed under international law. Princeton University, academics and the State Department also insisted his conviction was unjust.

“He is simply a bookish historian who traveled to Iran for research in 2016 and became swept up in the escalating tensions between the United States and Iran,” wrote Teresa Davis, a fellow at Emory University, in a Post opinion essay.

Iran has arrested a number of foreigners on charges their governments consider groundless, leading some critics to say that Iran has developed a hostage-taking industry as part of its foreign policy.

At least five other Americans are known to be imprisoned or missing in Iran. There are almost certainly more, but the exact number is not publicly known, in part because their families have been reluctant to publicize the cases for fear of angering Iranian authorities.

Siamak Namazi, an Iranian American businessman, has been detained since 2015. His elderly father, Baquer, a former UNICEF official, was arrested when he went to Iran four months after his son’s arrest to try to obtain his release. Babak Namazi, Siamak’s brother, has said he fears his father will die if he is not allowed to leave Iran to be treated for ailments that have been aggravated by his ordeal.

In a statement issued Saturday, Babak Namazi said he was “absolutely thrilled” for Wang and his family but “beyond devastated that a second President has left my ailing father Baquer Namazi and brother Siamak Namazi behind as American hostages in Iran in a second swap deal.”

“I hope, pray, and expect that this is not a one-time trade but the beginning of an expedited process that will bring my family home soon,” he said.

Robert Levinson, a former FBI agent, disappeared while on a visit to Iran in 2007. His family has not heard a word from him for years. But Iranian officials recently acknowledged having an open court case on Levinson, suggesting he is still alive and in custody more than 12 years after he was last seen. U.S. officials have said they raise Levinson’s name first in every interaction they have with the Iranians, either directly or through the Swiss, and have offered $25 million in rewards for information about his whereabouts.

Michael White, a Navy veteran, was arrested in 2018 while visiting his girlfriend in Iran, and was later sentenced to 10 years in prison for insulting Iran’s supreme leader and posting a private photograph publicly.

Morad Tahbaz, an environmental activist with citizenship from the United States, Iran and Britain, was working with the Persian Wildlife Heritage Foundation doing research on Iran’s endangered cheetah population when he and several other environmentalists were arrested last year and accused of espionage. Tahbaz was sentenced in November to 10 years in prison.