MUHAMMAD JAVAD ZARIF, Iran’s long-serving foreign minister and architect of its nuclear deal with America and the West, apologised for his shortcomings and resigned—by way of an Instagram post on February 25th. Within hours, Iran’s two rival camps—one still seeking engagement with the West, the other thirsting for confrontation—were at each other’s throats. The elected government of President Hassan Rouhani pressed Mr Zarif (pictured) to stay. The unelected authorities backed by the Islamic Revolutionary Guard Corps, spearhead of the hardliners, celebrated his demise. Rarely has the power struggle inside Iran been more exposed.

Mr Rouhani rejected the resignation as “against Iran’s benefit”. With #ZarifStay trending on Twitter, most members of parliament called on him to stick around. Several ambassadors threatened to follow Mr Zarif out. By contrast, agencies tied to the Guards rushed to confirm his departure. One of their loudest television mouthpieces, Vahid Yaminpour, hailed his “ejection from an aircraft in free fall”. Allies of the Guards also predicted that Bijan Zanganeh, the oil minister who has sought to conciliate the West, would go next. Hardliners even called for the ouster of President Rouhani himself.

Iran’s supreme leader, Ayatollah Ali Khamenei, who has the final say, has so far stayed silent. But Mr Zarif’s public protest testifies to his frustration with the power of the hardliners. They have blocked his efforts to keep Iran off the international blacklist of countries sponsoring terrorism by ratifying the terms of the Financial Action Task Force, an outfit based in Paris that seeks to curb money-laundering and the financing of terrorism. When on Monday the president of Syria, Bashar al-Assad, made his first visit, unannounced, to Tehran since the start of Syria’s civil war in 2011, Mr Zarif was excluded from the proceedings. Qassem Suleimani, the head of the Guards’ foreign legion, managed them instead.

Back in the Obama era, the Rouhani-Zarif team rubbed along well with the Americans. The deal to rein in Iran’s nuclear ambitions, signed in 2015, enabled most sanctions against Iran to be lifted. But the victory of President Donald Trump in 2016 and his decision to pull America out of the deal last year knocked the pragmatist tandem askew. Sanctions on banking and oil exports have been reimposed. Unemployment and inflation have soared. Iran’s currency has plummeted in value, along with Mr Rouhani’s popularity. Unrest is rising. “The Revolutionary Guards and Khamenei’s conservatives want a more radical government,” says Pejman Abdolmohammadi, an Iranian-Italian academic at the University of Trento in Italy.

The Guards have long made life trying for Mr Rouhani. Their intelligence units have forced out some of his ministers, even accusing them of ties to Mossad, Israel’s spy service. “They are trying to block everything, control everything,” says Kaveh Madani, a senior Iranian official who fled to America last year. They have increasingly indulged their habit of arresting dual nationals on flimsy grounds. They have put one of Mr Zarif’s fellow negotiators in jail on espionage charges despite objections from Mr Rouhani’s own security men. This month a brother of Mr Rouhani was put on trial for alleged corruption. “If they could, they would mount a coup,” says a Rouhani aide. A presidential election is not due until 2021, but talk of an early poll is growing.

The Guards would be happy to see the nuclear deal, to which Mr Rouhani’s circle still clings, formally revoked. They do not shrink from the prospect of rising confrontation with Saudi Arabia and the United Arab Emirates over Yemen or over disputed islands in the Strait of Hormuz. Nor do they mind American economic sanctions, because they help protect their vast business interests from international competition. And they seem positively to revel in the diplomatic isolation from the West that Mr Zarif has spent the past five years trying to end. For now Mr Rouhani appears to have persuaded Mr Zarif to stay on. But the two men may have to tailor Iran’s foreign policy more to the liking of the Guards.