Hassan Rouhani, Iran’s incumbent president and the “sheikh of diplomacy” who helped engineer the Iran nuclear deal, won a resounding mandate in a hard-fought reelection battle on Friday, sparking jubilation in the streets of Iran’s major cities.

Within Iran, the election’s outcome matters most for the anticipated disasters that it averted: the appearance of popular approbation for his opponent, a serial human rights abuser with aspirations of even higher office; the blatant rigging of the ballot accompanied the specter of unrest and international recriminations. Even from a distance, the reaction was tinged with an unmistakable note of relief that the doomsday scenarios of rigging or regression had been forestalled.

Rouhani’s victory (57 percent of the vote to Raisi’s 38 percent) does not alter the balance of power in the Islamic Republic—in the short term, it may reinforce the regime’s legitimacy—and it will not translate quickly or easily into the jobs or the freedoms that Rouhani promised to pursue with greater vigilance in a second term. Nor is it likely to fend off Washington’s determination to ramp up pressure on Tehran—a strategy that began unfolding with the simultaneous start to President Donald Trump’s visit to Saudi Arabia.

However, dismissing the ballots of 41 million Iranians as irrelevant or fake—as the Trump administration and some of its supporters were quick to do—represents a dangerous miscalculation in a region that can ill afford more American delusions. Iran’s election is not a quick fix to the problems facing Iranians or to those its government foments, but it is an essential step along the road to more responsible governance.

Multi-billion dollar arms sales and gilded conclaves of octogenarian autocrats will not beget the “better future” that Trump’s Riyadh speech rightly challenged the region to build. No strategy to address the instability that plagues the Middle East can succeed without the expansion of political participation, the expectation of government accountability, the enhancement of civil rights, and some measure of genuine competition for power. Having endured revolution, war, and isolation, Iranians appreciate that a better future begins with the ballot box, and a vote that galvanizes spontaneous (and unimpeded) street parties should be one that Washington welcomes.

The establishment rears up

Like his 2013 election, Rouhani’s win on Friday culminated a tense, unsettled campaign that highlighted the ideological fissures within Iran’s political establishment as well as the perennial dissatisfaction of its electorate. What should have been an easy extension of his presidency morphed into a fight for his political life after conservatives marshalled their efforts around Ibrahim Raisi, a hardline cleric who has been touted as a prospective successor to Iran’s supreme leader. Related Content Markaz State of Iran’s race: Rouhani v. Raisi Markaz Under Trump, U.S. policy on Iran is moving from accommodation to confrontation Markaz Is Rouhani going rogue?

The race became a referendum on the economy, an issue that has long served as a convenient proxy for the broader ideological divide within the Islamic Republic. It should have been a position of strength for Rouhani, who through a combination of cautious fiscal policy and successful nuclear diplomacy managed to decrease inflation four-fold and reverse several years of sanctions-induced contraction in the economy. However, Raisi made effective use of the deeply inculcated revolutionary commitment to social justice, hammering Rouhani on persistent unemployment and alleged corruption, and promising to triple cash subsidies to poor households.

Raisi’s apparent momentum was always underpinned by the strenuous support of the conservative establishment, and its readiness to deploy any means necessary to facilitate his election was always the wild card in the race. After all, they had rigged a presidential ballot before, and who better to help than the presumptive successor to the supreme leader?

In the campaign’s final days, as hardline press agencies touted polls that put the race as too close to call, Rouhani went on the offensive. He warned the security forces against interfering with the vote, scorned past use of “violent and extremist groups,” and alluded to Raisi’s role in some of the most vicious episodes of Iran’s post-revolutionary history, including the mass execution of thousands of political prisoners in 1988.

Reformist revival?

He did more than simply disparage his rivals; in the last week of the campaign, Rouhani explicitly embraced the mantle of the reform movement—a political agenda that he had opposed in its heyday and only sought to subtly coopt during his first term. He slammed the factional bias of the state broadcasters and the economic infringements of the Revolutionary Guard Corps, and promised to defend human rights and seek the end of all sanctions, a nod toward more negotiations with Washington. He posed the election as a choice between a lawyer and a judge, adding that a lawyer defends people while a judge issues sentences.

Rouhani disparaged his opponents for their “claims about freedom of speech and criticism,” exclaiming:

“How strange! Those who cut off tongues and sewed lips. Nothing has been heard from you but prohibition, ban on writing, and ban on media throughout the years. Please don’t you speak of freedom, it will be embarrassed. Please don’t you speak of criticism. You work for an organization that no one dares to criticize its performance.”

All of this could have come from the playbook of his predecessor, reformist icon Mohammad Khatami, whose name he invoked on the campaign trail and in his victory speech despite prohibitions related to Khatami’s support for the leaders of the 2009 post-election uprising.

The outcome carried a wave of reformists into city and local councils around the country, including in conservative bastions.

Rouhani’s eight million-vote advantage over Raisi is commanding, and it is bolstered by an even stronger showing in the elections of thousands of local officials that was wrapped into Friday’s vote. The outcome carried a wave of reformists into city and local councils around the country, including in conservative bastions such as Mashhad, the hometown of both Raisi and the supreme leader. In Tehran, reformists literally took every seat on the city council, which will surely mean that Tehran mayor Mohammad Baqr Qalibaf, who ended his third run for president to throw his support behind Raisi, will now be out of a job. That his likely replacement is the son of the late Ali Akbar Hashemi Rafsanjani, Iran’s original pragmatic president, only adds to the sense that this was a wholesale revival of the prospects of reforming Iran.

Tricky course ahead

There is a natural temptation to view Rouhani as strengthened by the election’s resounding outcome. Unfortunately, that’s unlikely. In fact, the fiercely fought campaign exposed the deep polarization within Iranian society, and while Rouhani easily defeated Raisi, each of his electoral victories came with a lower proportion of the popular vote than any prior presidential ballot, hinting that Iranian elections are becoming more competitive. Some substantial proportion of the electorate harbors deep resentment toward not just the leadership but the “four percent,” as Qalibaf described that segment of Iranians who have prospered as a result of their proximity to power. They are susceptible to populist promises, and view the economic and diplomatic openings with trepidation rather than relief.

[T]he fiercely fought campaign exposed the deep polarization within Iranian society.

Raisi’s nearly 16 million votes suggest that the conservative base has not expanded much over the course of the past four years, but neither has it diminished. The guardians of orthodoxy within the Islamic Republic can count on a sizeable blocking minority, and, through a quick round of complaints over electoral procedures, Raisi has signaled he does not intend to shrink quietly back to the seminary. More importantly, they have levers beyond the ballot box at their disposal, including the leadership of the security forces, the judiciary, and a willingness to use any means necessary.

In this respect, Rouhani faces a familiar problem. In veering left, he surely helped secure strong turnout—74 percent—and probably swayed many of those who grew disappointed with what the nuclear deal has delivered. However, he also committed himself publicly to making progress on issues where he has only the most tenuous authority and where Khatami, aided by a reformist parliament, ultimately failed to generate meaningful change.

For this reason, his second term begins with an even stiffer challenge than his first. Dashed expectations among some proportion of the public after his first administration threatened his reelection; Rouhani will have to maneuver skillfully to avoid an even more dramatic disconnect between public demands and government achievements over the next four years. At his first post-election news conference, Iranian journalists burst into applause when a questioner advised him to continue behaving as he had during the final week of the campaign.

Rouhani’s rhetoric also cut dangerously close to the bone for the legitimacy of Iran’s ruling system, which remains fixed around the absolute authority of the supreme leader. That will surely not be forgotten, particularly at a time when the prospect of succession looms large. Raisi’s loss will make his speculated elevation deeply problematic, at least if it were to happen before the end of Rouhani’s presidency in 2021. Institutions matter more than individuals in the Islamic Republic, and the primacy of the leader’s office has to be protected. At 77 years old, the timing is hardly within Khamenei’s control, but it’s worth noting that Ayatollah Ruhollah Khomeini, Iran’s original supreme leader, survived in office until the age of 86.

What about Trump?

Iranians were still celebrating Rouhani’s victory when President Trump landed just across the Persian Gulf in his inaugural foreign visit. The confluence exacerbated the jarring sense of disconnect that accompanied Trump’s tough talk about Tehran before the leaders of more than 55 Muslim-majority nations. Trump urged that “all nations of conscience must work together to isolate Iran, deny it funding for terrorism, and pray for the day when the Iranian people have the just and righteous government they deserve.”

Rouhani seemed to leave the door open to Trump.

Unsurprisingly, Trump’s message fell flat among Iranians, generating derisive reactions on social media including from Iran’s foreign minister. In his news conference, Rouhani dismissed the Riyadh summit as a “show” and lightly mocked the Saudis for their attachment to hereditary rule and their reliance on American military technology and advising.

More importantly, Rouhani seemed to leave the door open to Trump, suggesting that the administration is still learning on the job and reminding Iranians—and the world—that negotiations have proven the most effective tool for resolving bilateral differences between Washington and Tehran.

It is a message that the Trump administration would do well to heed, even in the triumphal aftermath of the Riyadh summit. Every U.S. president, both Republican and Democratic, has sought to engage in direct diplomacy with Tehran. Just as Trump was persuaded to jettison his anti-Islamic rhetoric in order headline a Muslim summit with the leaders of 55 Muslim-majority countries, the exigency for dialogue with Iran will surely arise. Given developments in Iraq and Syria, that time may come sooner rather than later.