Iran and the U.S. conducted a prisoner swap on Saturday, which saw the release of an American graduate student in return for an Iranian scientist held by Washington.
"Glad that Professor Massoud Soleimani and Mr. Xiyue Wang will be joining their families shortly," Iranian Foreign Minister Javad Zarif said on Twitter.
"Many thanks to all engaged, particularly the Swiss government."
Switzerland represents U.S. diplomatic interests in Iran, since Washington and Tehran severed diplomatic relations shortly after the 1979 Islamic Revolution in Iran.
Soleimani, a stem cell expert, was arrested in the U.S. in 2018 for allegedly violating U.S. sanctions on Iran over its nuclear program.
Wang, a U.S. citizen, was held by Tehran in 2016 on espionage charges.
U.S. President Donald Trump confirmed Wang's release.
"We thank our Swiss partners for their assistance in negotiating Mr. Wang’s release with Iran," he said in a statement.
"The highest priority of the United States is the safety and well-being of its citizens. 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."
U.S.-Iranian relations have strained since the Trump administration unilaterally withdrew from a 2015 nuclear deal between Tehran and world powers and re-imposed sanctions on the Islamic Republic.