Long-festering tensions within Iran’s foreign policy and security elite blew wide open after the country’s high-profile foreign minister Mohammad Javad Zarif declared in an Instagram post late Monday that he was leaving the position after more than six and a half years.

Mr Zarif’s announcement, which has yet to be accepted by Iran’s President Hassan Rouhani, set off a flurry of political manoeuvring and speculation, and dominated conversation and headlines in Iran.

Some in Iran’s diplomatic corps on Tuesday threatened to resign, prompting Mr Zarif to urge them to stay put.

“I am calling all of my brothers and sisters in the Foreign Ministry and our representative offices to continue their duties,” he said in staff memo, quoted by several news agencies. “Hopefully my resignation will serve as a spark to bring the Foreign Ministry back to its mandated position in foreign relations.”

Across the world, diplomats and officials wondered what Mr Zarif’s potential departure would mean for the Joint Comprehensive Plan of Action (JCPOA) – the landmark 2015 nuclear deal signed by Iran and world powers before it was abandoned last year by US President Donald Trump’s administration, leaving Tehran and the other signatories struggling to uphold it.

“If he’s really gone, which looks increasingly likely I guess, it must be a bad sign”, a former senior US official told the Independent.

“Big question is do they start taking their first steps on the nuclear side that contravene the deal.”

Revolution in Iran: In pictures Show all 11 1 /11 Revolution in Iran: In pictures Revolution in Iran: In pictures A demonstration against the Shah in 1979 Getty Revolution in Iran: In pictures Armed women on guard in one of the main squares in Tehran at the beginning of the Iranian Revolution Getty Revolution in Iran: In pictures Demonstrators hold a poster of Ayatollah Ruhollah Khomeini, in January 1979, in Tehran, during a demonstration against the Shah AFP/Getty Revolution in Iran: In pictures Iranian rebels pose with a U.S. flag they bayonetted upside down on trees at Sultanabad Garrison northeast of Tehran on February 12 2019 AP Revolution in Iran: In pictures A gun battle in Khorramshahr during the revolution, 1979 Getty Revolution in Iran: In pictures Ayatollah Khomeini's supporters demonstrate in the streets of Tehran against the Shah among tear gas. The "black friday" caused the death of 200 people according to the Iranian government, 2000 according to the opposition, September 8 1978 AFP/Getty Revolution in Iran: In pictures Women wearing the traditional Chador demonstrate in the streets of Tehran against the Shah on September 7 1978 AFP/Getty Revolution in Iran: In pictures Demonstrators in Tehran calling for the replacement of the Shah of Iran during the Iranian Revolution, 1979. They carry placards depicting Ayatollah Mahmoud Talaghani, one of the leading revolutionaries Getty Revolution in Iran: In pictures Ayatollah Khomeini's supporters demonstrate in the streets of Tehran against the Shah. The "black friday" caused the death of 200 people according to the Iranian government, 2000 according to the opposition, September 8 1978 AFP/Getty Revolution in Iran: In pictures Thousands of the Ayatollah Khomeini's supporters on the streets of Tehran calling for the religious leader's return in January 1979 Getty Revolution in Iran: In pictures The Iranian Islamic Republic Army demonstrates in solidarity with people in the street during the Iranian revolution. They are carrying posters of the Ayatollah Khomeini, the Iranian religious and political leader Getty

Some were happy to see Mr Zarif’s possible exit. “Good riddance,” tweeted Israeli Prime Minister Benjamin Netanyahu, in a sentiment echoed by both conservative think tanks in Washington and hardliners in Tehran.

“Close the door behind you and never come back, Yankee!” wrote Zahra Tabakhi, a conservative Iranian journalist, in a tweet.

Mr Rouhani, in a speech on Tuesday, did not mention the resignation, but praised Mr Zarif, amid reports that he was trying to convince him to stay.

“If our Foreign Ministry is doing something, it is because it is from the people and it represents the people,” said Mr Rouhani.

His chief of staff, Mahmoud Vaezi posted a photograph of the president and Mr Zarif working closely together, and insisted that Mr Rouhani was “completely satisfied” with his foreign minister.

Despite Mr Rouhani’s entreaties, Mr Zarif may be holding out for a gesture of support from supreme leader Ali Khamenei.

Mr Zarif’s announcement came just hours after his visible absence during the first public visit of Syrian president Bashar al-Assad to Tehran since that country descended into a years-long civil conflict.

In his place, seen in meetings with both President Hassan Rouhani and Ayatollah Khamenei, was Qassem Suleimani – the powerful commander of Quds force, the clandestine overseas division of the Revolutionary Guards (IRGC).

Mr Zarif had apparently been kept in the dark about Assad’s surprise visit, and while there is no sign that the foreign minister opposed Iran’s steadfast support for the Damascus regime, he has been frustrated by being kept out of the loop on significant policy matters.

“This was the last straw that broke the camel’s back,” said Maysam Behravesh, a researcher and Iran expert at Lund University in Sweden.

“Zarif’s curious and conspicuous absence from Syrian President’s meeting with Khamenei, Rouhani and Soleimani took many off guard,”

The slight, documented in state news agency photos and shared on social media, apparently outraged Mr Zarif, who told an Iranian newspaper that “after the pictures today, Javad Zarif has no credibility in the world as Iran’s foreign minister.”

Shortly afterward, he posted his resignation on Instagram: “I would like to sincerely apologise for not being able to continue my service and for all my shortcomings during my service.”

Iran's Foreign Minister tells NBC News that starting a war with Iran would be ‘suicidal'

One Western diplomat who works on Iran policy matters said he understands that “the pressure of the IRGC” may have contributed to the resignation.

As for the JCPOA: “The supreme leader doesn’t seem to want to get out of the deal but to test limits to send a message,” he told the Independent.

The US-educated Zarif, long a fixture of the moderate factions of Iran’s political elite, had previously served as Tehran’s envoy to the United Nations. He was a key architect of the nuclear deal, forging a partnership with then US Secretary of State John Kerry, as well as EU foreign policy chief Federica Mogherini.

While it is unlikely that Ayatollah Khamenei or Mr Rouhani would immediately abandon the deal, it remains unclear whether any successor to Mr Zarif would have the diplomatic skills, personal ties, and strong motivation to maintain it.

“There seems to be a fragile collective consensus within Iran’s wider leadership that the handicapped nuclear deal is still worth keeping, but this can change once its most vocal and solid backer is out of the game,” said Mr Behravesh.

Being the most public face of an isolated Middle East country seeking to build up trade ties with the West, without scuttling the utopian ideals of a 40-year revolution, was never going to be easy.

But Mr Zarif has been facing numerous pressures that have likely made his job especially challenging.

Mr Trump’s decision last year to abandon the nuclear deal badly damaged Mr Zarif’s credibility among regime hardliners who opposed any rapprochement with the West. He has become a lightning rod of criticism by an often unelected but powerful collection of hard-line stalwarts in the clerical and security establishments, who are skeptical about his outreach to the West.

A photo published recently showed Mr Zarif in apparent physical anguish as he sought to convince such lawmakers about the importance of upgrading Iran’s money-laundering rules to bring them in line with international standards as a prerequisite to robust trade with the West.

Mr Zarif is also under pressure by Iran’s Western allies, including France, Germany, and UK. Lacking any other interlocutor, European diplomats have been pressing Mr Zarif and his foreign ministry colleagues to scale back deployment of militias and hardware to Syria and Iraq, ease the expansion of its missile programme, and comply with money laundering standards – all matters over which the foreign ministry has little control.

“What has driven Zarif crazy is the Rouhani administration’s handling of some files, in particular Bashar Assad’s visit,” said Adnan Tabatabai, co-founder of the Center for Applied Research in Partnership with the Orient, a Bonn think tank.“It’s a sign of frustration with Rouhani.”

In addition to the president’s appeal, a group of 150 Iranian lawmakers on Tuesday were petitioning Mr Rouhani to reject the resignation and for Mr Zarif to stay in his post, according to official news agencies.

“I strongly believe Rouhani will try to bring Zarif back,” said Mr Tabatabai. “But this has to be done in a face-saving manner and it is yet to be seen to be done.”

Mr Zarif’s departure may ignite a struggle for control of the foreign ministry. Already elements of the clandestine services and the Revolutionary Guard have been accused of using Iran’s diplomatic outposts to carry out potentially violent operations abroad, and to heighten tensions with the West, all of which could intensify.

His resignation, if embraced, could also embolden US hardliners who’ve been generally thwarted in their efforts to isolate Iran. Mr Zarif has earned a measure of admiration even from his critics for his passionate and sometimes effective defence of Iran in the international media and at global forums, including at the Munich Security Conference this month.

“He was acting as a remarkable brake on the confrontational policies and ambitions of Iranian hardliners,” said Mr Behravesh. “Abroad, he was hampering the Trump administration’s efforts to optimally exercise its ‘maximum pressure’ policy against Iran by calling out its contradictions, perils, and consequences.