The United States and Iran swapped prisoners on Saturday in a rare act of co-operation between the longtime foes whose ties have worsened since President Donald Trump took office.
Mr Trump said Chinese-American Xiyue Wang was returning to the United States after being held in Iran for three years on spying charges, while an Iranian official said that scientist Massoud Soleimani had been freed from detention in the United States.
The exchange was facilitated by Switzerland and took place there. The Iranian state news agency IRNA said Foreign Minister Mohammad Javad Zarif welcomed Mr Soleimani in Zurich and said the scientist was expected to return to Iran soon.
In a statement issued by the White House, Trump made no mention of the freeing of Mr Soleimani but thanked the Swiss government for its help in negotiating Mr Wang's release.
"Freeing Americans held captive is of vital importance to my Administration, and we will continue to work hard to bring home all our citizens wrongfully held captive overseas," he said.
Mr Zarif said earlier that the prisoner swap was imminent. Later he posted pictures on Twitter of himself with Mr Soleimani before boarding an Iranian plane and then chatting on board with the simple message: "Going home."
The Swiss Embassy in Tehran looks out for America's interests in the country as the US Embassy there has been closed since the 1979 student takeover and 444-day hostage crisis.
Brian Hook, the US special representative for Iran, accompanied the Iranian scientist to Switzerland to make the exchange, according to a US official who spoke before the swap had confirmed. Mr Hook accompanied Mr Wang to Landstuhl in Germany where the student would be examined by doctors, the official said.
Mr Hook is expected to return to the US from Germany alone, as Mr Wang is expected to be evaluated for several days.
Although Mr Hook was present for the swap, the official said Trump's national security adviser Robert O'Brien played the lead role in the negotiations dating from his time as the special representative for hostage affairs at the State Department.
Mr Wang was sentenced to 10 years in prison in Iran for allegedly "infiltrating" the country and sending confidential material abroad. His family and Princeton University strongly denied the claims. Iran has detained dual Iranian nationals and those with Western ties in the past to be used as bargaining chips in negotiations.
Mr Soleimani who works in stem cell research, haematology and regenerative medicine – was arrested by US authorities on charges he had violated trade sanctions by trying to have biological material brought to Iran. He and his lawyers maintain his innocence, saying he seized on a former student's plans to travel from the US to Iran in September 2016 as a chance to get recombinant proteins used in his research for a fraction of the price he would pay at home.
Tensions have been high between Iran and the US since President Trump unilaterally withdrew America from Tehran's nuclear deal with world powers in May 2018. In the time since, the US has imposed harsh sanctions on Iran's economy. There also have been a series of attacks across the Mideast that the US blames on Iran.