Almost a week after Iran's Foreign Minister Mohammad Javad Zarif submitted his resignation over Instagram, it's become clear that Zarif made a high-risk gamble -- and it paid off handsomely. Calculating that both the public and many in the political elite would rally behind him, his wager compelled key Iranian leaders to renew their confidence in him.
And with the Iran nuclear deal facing existential challenges over the next few months, the boost for Zarif could not have come at a better time.
Zarif is not the first Iranian official to make this gamble. In 1952, Prime Minister Mohammad Mossadegh found himself curtailed by Shah Mohammad Reza Pahlavi. The Iranian Constitution gave Mossadegh the prerogative to name the minister of war, a portfolio Mossadegh sought to hold himself. The Shah balked, fearing that Mossadegh was angling to reduce the Shah's authority at a time when Mossadegh's popularity was rising due to his campaign to nationalize Iran's oil industry and prevent Britain from keeping all the revenue from Iran's most valuable natural resource.
Mossadegh decided to raise the stakes. He sent a letter of resignation to the Shah, stating that "in the actual situation it is not possible for the Iranian people to be victorious in the struggle which it has begun," indirectly suggesting that the Shah was undermining Iran in its dispute with the British and directly appealing to the public to rally behind him.
The Shah tried to outmaneuver his premier. He accepted Mossadegh's resignation and appointed Ahmad Ghavam as the new prime minister. Ghavam was an Iranian politician who favored a softer approach toward the British. As Mossadegh had predicted, the decision did not go down well with the Iranian public. Five days of strikes and nationwide protests ensued.
Under pressure, the Shah dismissed Ghavam and reinstated Mossadegh -- and granted him the control over the armed forces that was at the center of the standoff. Within five days of handing in his resignation, Mossadegh emerged greatly strengthened and more popular than ever. (The victory was short lived, however, as the United States and the United Kingdom organized a coup against Mossadegh a year later).
But not all such gambits have paid off. In 2011, the hardline Mahmoud Ahmadinejad tried his own wager. Infuriated by Ayatollah Sayyid Ali Hosseini Khamenei's reinstatement of a Cabinet minister Ahmadinejad had fired, the Iranian hardliner simply stopped showing up for work. He didn't even attend his own Cabinet meetings, hoping this would force Khamenei to relent.
It did not. Instead, Khamenei gave Ahmadinejad an ultimatum: Accept the Supreme Leader's intervention or resign. After 11 days of sulking, Ahmadinejad returned to work with his tail between his legs, humiliated and weakened.
Zarif's wager was more sophisticated. When the Joint Comprehensive Plan of Action (also known as the Iran deal) was reached, Zarif's popularity was at its peak. He was given a hero's welcome at the Tehran airport usually reserved for Olympic gold medalists, not foreign ministers. But President Donald Trump's crusade against the nuclear deal has left Iranians deeply disappointed. The economic benefits Iran was promised were never delivered, and with Trump's new sanctions -- combined with the government's own mismanagement and corruption -- ordinary Iranians face a very dim economic future.
Trump's sabotage of the Iran deal gave space to hardliners in Iran to attack the Hassan Rouhani government for seeking to accommodate the West. Increasingly, they were scapegoating Zarif, not only to block his efforts to keep Iran inside the deal and press Iranian banks to adopt international transparency standards, but also to block any future diplomatic efforts with Washington. In Iran, Zarif is synonymous with diplomacy.
The hardliners were closing in on Zarif. But after his performance at the Munich security conference last month -- which once again boosted his popularity and even forced Iranian hardliners to grudgingly praise him -- Zarif saw his opportunity. Following Mossadegh's example, he announced his resignation publicly to maximize the likelihood of a public outcry in his favor.
The shrewd Iranian diplomat-turned-academic-turned-politician knew very well that the resignation was meaningless, short of Rouhani and Ayatollah Khamenei's acceptance. Which he calculated they wouldn't provide due to the political cost.
Indeed, within 24 hours, the Tehran Stock Exchange was plummeting and 150 members of Parliament issued a letter urging Rouhani to reject Zarif's resignation; all the while Rouhani was sending emissaries to Zarif, pleading with him to return and insisting that the resignation was "against national interests."
Even key conservatives felt compelled to praise Zarif. The powerful commander of Iran's Quds Forces, Qassem Soleimani, publicly lauded Zarif as someone who "has always been supported by the top officials, especially the Supreme Leader." And less than two days into the drama, word was out that Ayatollah Khamenei believed that Zarif's resignation was not "expedient," signaling his crucial support for Zarif as well.
Zarif is now serving as foreign minister per the insistence of the Supreme Leader himself, providing him with much-needed protection against Iran's anti-diplomacy hardliners.
But it is not just Iran's hardliners who were left weakened and disappointed by Zarif's success. Proponents of confrontation with Iran in Washington, Riyadh and Tel Aviv were all caught celebrating Zarif's departure prematurely.
"Zarif is gone -- good riddance," Israeli Prime Minister Benjamin Netanyahu said only hours into the drama, revealing his inability to understand the political machinations in the country he defines as an existential threat to Israel. Saudi Arabian Deputy Defense Minister Prince Khalid Bin Salman, in turn, wishfully tweeted that the episode had left Zarif's authority diminished, echoing hawks in the United States who insisted that Zarif's victory was pyrrhic at best.
For the survival of the Iran deal, the strengthening of Zarif is crucial. By all accounts, the economic situation in Iran is going to continue to deteriorate as Trump escalates his economic war. The European Union effort to set up an alternative payment system for legal trade with Iran, called INSTEX, is, according to EU diplomats, more of a political signal in support of the deal than a measure to provide Iran the economic relief it has been promised.
To make matters worse, the tenures of two principal defenders of the deal in Europe -- Federica Mogherini and Helga Schmid -- come to an end in May. This will leave Zarif as the only architect of the deal who continues to hold office, besides Russian Foreign Minister Sergey Lavrov.
Zarif's strengthened position is also crucial for two other reasons. It signals to the Trump administration that its attempt to frustrate the Iranians into exiting the deal -- which could potentially pave the way for military action against Iran -- is failing. In other words, Zarif's presence deprives international hardliners of the pretext for war they have been so desperately seeking.
But it also serves as a warning to future Democratic administrations: The United States would be wise to seek a clean re-entry into the Iran deal -- without any misguided temptations to issue preconditions for the United States to uphold its obligations.
Just as the Democrats would reject any foolish attempts to renegotiate the Paris climate agreement, they should do so for the Iran deal. If they were to approach the two multilateral agreements differently, as some have suggested, then Democrats would be continuing Trump's sabotage-and-renegotiate strategy, signaling to the Iranians that Zarif was wrong and the hardliners were right all along: America cannot be trusted.
Trita Parsi is the author of Losing an Enemy -- Obama, Iran and the Triumph of Diplomacy. He teaches at Georgetown University's Center for Security Studies. The views expressed in this commentary are his own. View more opinion on CNN.