Iran freed an American held prisoner for the past three years, the White House said Saturday, while Iran said the U.S. was freeing an Iranian scientist held in America in return.

"After more than three years of being held prisoner in Iran, Xiyue Wang is returning to the United States," the White House said in a statement Saturday morning. "A Princeton University graduate student, Mr. Wang had been held under the pretense of espionage since August 2016."

Meanwhile, Iranian Foreign Minister Javad Zarif wrote on Twitter: "Glad that Professor Massoud Soleimani and Mr. Xiyue Wang will be joining their families shortly."

A senior U.S. official confirmed the release of Massoud Soleimani for Xiyue Wang.

U.S. authorities arrested Soleimani over trade sanction violations, according to The Associated Press. "He and his lawyers maintain his innocence, saying he seized on a former student's plans to travel from the U.S. to Iran in September 2016 as a chance to get recombinant proteins used in his research for a fraction of the price he'd pay at home."

The White House and Zarif both thanked the Swiss government for helping in the negotiations.

This story will be updated.

NPR's Steve Inskeep contributed reporting.

Copyright 2019 NPR. To see more, visit