UNITED NATIONS (AP) — An 85-year-old Iranian-American who formerly worked for the U.N. children’s agency and was detained in Iran in 2016 has been permitted to leave the country for medical treatment abroad, the United Nations said Saturday.

U.N. spokesman Stephane Dujarric announced the departure of Baquer Namazi and said Secretary-General Antonio Guterres was grateful he could leave following the U.N. chief’s appeals to Iranian President Ebrahim Raisi.

Dujarric said the secretary-general was also pleased that Namazi’s son, Siamak Namazi, had been released from detention.

An international human rights lawyer handling their case, Jared Genser, tweeted Saturday: “I am delighted to confirm for the first time in seven years that Siamak #Namazi is spending a night at home with his parents in Tehran. Baquer Namazi’s travel ban has been lifted. We won’t rest until they return to the U.S. & their long nightmare has ended.”

Namazi, a former UNICEF representative, was detained in 2016 when he traveled to Tehran to see his son, a businessman arrested in Iran months earlier. Both Namazis were sentenced to 10 years in prison in Iran on what the United States and United Nations say were trumped-up spying charges.

Baquer Namazi was granted medical furlough in 2018 and his sentence was subsequently commuted to time served, but Iranian authorities had not permitted him to leave the country. Last October, he underwent surgery in Iran to clear a blockage in an artery to the brain that his family and supporters described as life-threatening.

Siamak Namazi had remained jailed in Iran’s notorious Evin prison.

Dujarric said the U.N. “will continue to engage with the Iranian authorities on a range of important issues, including the regional situation, sustainable development and the promotion and protection of human rights.”

The State Department said it was gratified to learn of Iran’s actions but added that “our efforts are far from over.”

“We remain committed and determined to securing the freedom of all Americans unjustly detained in Iran and elsewhere. They should be reunited with their loved ones as soon as possible,” State Department spokesperson Ned Price said in a statement.