According to the United Nations, an American detained in Iran can leave the country again after six years.

Following an appeal by UN Secretary-General Antonio Guterres, 85-year-old Baquer Namazi "was allowed to leave Iran for medical treatment abroad," UN spokesman Stephan Dujarric said on Sunday.

The man's son, 50-year-old Siamak Namazi, was released from Iranian custody.

The United States has long been pushing for the release of the two men and two other Americans.

Baquer Namazi is a former Unicef ​​employee who was arrested in February 2016 after traveling to Iran to secure his son's release.

He was arrested in October last year.

Both were sentenced to ten years in prison in October 2016 for espionage.

The father was released from prison in 2018 on medical grounds and placed under house arrest.

US State Department spokesman Ned Price said his administration was "extremely pleased" with the lifting of the travel ban.

Both men were "wrongly" imprisoned.

The other two Americans being held in Iran are environmental activist Morad Tahbaz, 66, and businessman Emad Sharqi, 57.

The negotiations to release the Americans are taking place against the background of a revival of the 2015 nuclear deal.

The agreement was intended to prevent Tehran from developing nuclear weapons.

Under then-President Donald Trump, the United States unilaterally withdrew from the agreement in 2018 and imposed massive new sanctions on Iran.