Baquer Namazi and his son Siamak Namazi. The U.N. Working Group on Arbitrary Detention said on Sept. 18, 2017, that both men, Iranian Americans serving 10-year prison sentences on spying charges in Iran, should be immediately freed and paid restitution. (Babak Namazi/AP)

An elderly U.S. citizen with a heart ailment was hospitalized and given a pacemaker Tuesday shortly before President Trump demanded that Iran release all Americans and other foreigners he described as unjustly detained.

The health of Baquer Namazi, 81, who had undergone triple bypass surgery before being imprisoned 18 months ago and convicted of espionage in a secret trial, has raised concerns that the former UNICEF official might die in custody.

At least three other Americans are imprisoned in Iran, and a fourth has been missing for a decade, but Namazi’s health is considered particularly fragile. The United States does not have diplomatic relations with Iran, so it has asked Switzerland, the U.S. protecting power in Iran, and other countries with embassies in the country to urge Tehran to release him.

Namazi was rushed to a hospital in Tehran on Monday, five days after a cardiologist recommended that he be taken immediately to a cardiac-care unit for tests, Namazi’s son Babak said in an interview in New York City.

But prison guards insisted on taking the elder Namazi back to Evin Prison, where a staff physician said urgent hospital care was unnecessary, Babak Namazi said.

At the United Nations General Assembly Sept. 19, President Trump called for preservation of sovereignty and slammed leaders in North Korea, Iran, Cuba and Venezuela. Here are key moments from that speech. (Sarah Parnass/The Washington Post)

On Monday, as Baquer Namazi’s health deteriorated, he was rushed to the hospital. An angiogram showed his condition was serious enough that a pacemaker was put in, said Babak Namazi, who learned of his father’s health crisis from family members in Iran. He was expected to be returned to Evin Prison on Wednesday, his son said.

“What’s next?” said Babak Namazi, whose brother, Siamak, also has been convicted of espionage and has been imprisoned in Evin for almost two years. “What do I need to do as a son to get my father home, alive?”

It is unclear whether any progress will be made at the United Nations this week on the case of the U.S. prisoners. Iranian President Hassan Rouhani, who addressed the U.N. General Assembly on Wednesday, spoke with Secretary General António Guterres on Monday. But the U.N. leader’s spokesman declined to say whether they had discussed Namazi. Foreign Policy reported that Guterres, who headed the refugee agency for which the elder Namazi worked, wrote confidentially to Rouhani this summer asking for Namazi’s release on humanitarian grounds.

Relations between the United States and Iran, longtime foes that talk to each other only at periodic joint committee hearings to discuss the progress of the 2015 nuclear deal, have worsened since Trump came to office vowing to ditch the agreement negotiated with Iran by the Obama administration and five other world powers.

When the Iran nuclear deal took effect in January 2016, it involved a prisoner swap that freed five Americans, including Washington Post reporter Jason Rezaian.

The United States hopes Iran will release on humanitarian grounds the remaining Americans, including two taken into custody since the Iran deal was implemented.

Xiyue Wang, a Princeton graduate student, was arrested last August while conducting historical research and sentenced to 10 years for espionage and “assisting a hostile government.” He also has suffered health problems in detention.

Karan Vafadari, an Iranian American who owns an art gallery in Tehran, was arrested with his wife in July 2016 and accused of holding mixed-gender parties where the couple served alcohol.

A former FBI agent, Robert Levinson, has been missing in Iran for more than 10 years.

The case of the Namazis, father and son, has drawn the most attention, because they are well known Iranian American business executives. Siamak Namazi, who promoted closer ties between the United States and Iran, was detained in October 2015. His father was picked up four months later when he went to Iran to try to free his son. Both were tried and convicted of collaborating with the United States and sentenced to 10 years in prison.

In his speech at the United Nations on Tuesday, Trump called on Iran to free all the Americans, although he did not mention their names.

“It is time for the regime to free all Americans and citizens of other nations that they have unjustly detained,” he said.

On Monday, the U.N. Working Group on Arbitrary Detention said the Namazis should be freed immediately and paid restitution. It called their detention arbitrary and part of an “emerging pattern” of Tehran’s targeting dual nationals, a status Iran does not recognize.

Some of the prisoners are said to be in poor health and growing despondent.

Relatives fear that Siamak Namazi, who reportedly has been beaten and shocked with a stun gun, may take his own life. Nazanin Zaghari-Ratcliffe, a British Iranian woman serving five years on national security charges, is said to be losing her hair and experiencing depression. Nizar Zakka, a Lebanese technology specialist with a U.S. green card who had worked on State Department contracts, has gone on hunger strikes. Baquer Namazi is reported to have lost 35 pounds.

Babak Namazi said he came to the United Nations’ big annual meeting, as he did last year, because his father belonged to the U.N. family and because New York City is filled with diplomats he hopes may be able to help. He wants to plead his father’s case with senior U.S. officials, including Secretary of State Rex Tillerson.

“Today the world came together at the U.N. to talk about issues, including the American hostages. What does it take to get an 81-year-old man free? I need to get him back, and I need to get him back alive. If this continues, we will be facing a tragedy.”