ISTANBUL — Iranian President Hassan Rouhani rose to his foreign minister’s defense as he formally rejected Mohammad Javad Zarif’s resignation, and the two appeared together Wednesday to greet the Armenian prime minister in Tehran.

In a letter published by state media, Rouhani said accepting Zarif’s resignation would be “against national interests.”

He called Zarif an “honest, brave and pious person” and praised his efforts to “resist intense pressure from the United States.”

The rejection of the resignation ended, at least temporarily, a high-stakes political drama that consumed the Iranian capital this week.

“I appreciate the support of the people of Iran . . . especially in the past 30 hours,” Zarif, 59, wrote Wednesday in an Instagram post. “As a modest servant, I have never had any concern but elevating the foreign policy and status of the Foreign Ministry.”

Zarif, who in recent years has become the global face of Iran’s push to engage with the West, submitted his resignation late Monday in a shocking decision that he said was made to “defend the integrity” of the Foreign Ministry. Media reports said he was furious at his exclusion from a high-level meeting with Syria’s president that day.

The meeting was also attended by Rouhani; Iran’s supreme leader, Ayatollah Ali Khamenei; and a senior Revolutionary Guard Corps commander, Maj. Gen. Qasem Soleimani, who heads the Guard’s elite Quds Force. Iran and Syria are close allies.

Zarif, the pro-reform Entekhab newspaper reported, said in a message that he had “no credibility in the world as a foreign minister” after images of the Iranian leaders’ meeting with Syrian President Bashar al-Assad were published.

The incident highlighted tensions between Zarif and his allies in the government and more hard-line elements within Iran’s broader power structure. The two sides have sparred over the merits of Iran’s 2015 nuclear deal with world powers and engagement with the West more generally.

Zarif, who was educated in the United States, was a key architect of the agreement, which curbed Iran’s nuclear program in exchange for widespread sanctions relief. The Trump administration withdrew from the pact last year and reimposed a near-total embargo on Iran’s economy.