This photo provided by U.S. Embassy Switzerland, Edward McMullen greets Xiyue Wang in Zurich, Switzerland on Saturday, Dec. 7, 2019. In a trade conducted in Zurich, Iranian officials handed over Chinese-American graduate student Xiyue Wang, detained in Tehran since 2016, for scientist Massoud Soleimani, who had faced a federal trial in Georgia. (U.S. Embassy Switzerland via AP)

DUBAI – The United States and Iran swapped prisoners – a Chinese-American detained for three years on spying charges and an imprisoned Iranian – on Saturday in a rare act of cooperation between two longtime foes whose ties have worsened since President Donald Trump took office.

Trump said Chinese-American Xiyue Wang was returning to the United States. An Iranian official said that Iranian Massoud Soleimani had been freed from detention in the United States.

Switzerland facilitated the swap and Iranian state news agency IRNA said Foreign Minister Mohammad Javad Zarif welcomed Soleimani in Zurich, where it said the swap took place. It said Soleimani was expected to return to Iran in the coming hours.

In a statement issued by the White House, Trump made no mention of the freeing of Soleimani but thanked the Swiss government for its help in negotiating 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.