By electing Hassan Rowhani, the moderate candidate, to be its next president, the Iranian people have in effect reached a provisional compromise with the nation's supreme leader, Ayatollah Ali Khamenei, and the ultraconservative establishment.

At first glance, Rowhani's landslide victory might seem baffling. Why should an otherwise subordinate and overly cautious candidate, who was once Iran's lead nuclear negotiator, generate so much enthusiasm and support among a beleaguered public? Rowhani largely kept out of the postelection upheavals in 2009, and his campaign platform did not offer anything remotely resembling a reformist agenda. To the extent that he challenged any establishment views, his criticisms and proposals were mainly directed against the irascible style and tactless temperament of President Mahmoud Ahmadinejad, an easy target.

Given these apparent paradoxes, it would seem that Rowhani's decisive victory is owed to the absence of any meaningful alternatives. Indeed, the regime's Orwellian vetting body, the Guardian Council, went out of its way this time around to ensure a tame field of candidates, a soporific roster of former and current technocrats. Most notably, and with tacit acquiescence of the supreme leader, the Guardian Council rendered ineligible one of the founding fathers of the Islamic Republic, former President Ali Akbar Hashemi Rafsanjani (it also barred Ahmadinejad's handpicked candidate, Esfandiar Rahim Mashaei), seemingly leaving Rowhani as the most palatable choice.

But the sheer scale of Rowhani's victory (capturing nearly 51% of the vote over four other candidates, with an official turnout of 72%) suggests a more compelling explanation than the one describing him merely as the least bad option.

To better understand the meaning of Rowhani's victory, we must take heed of the shadow of the disputed 2009 presidential election - in which charges of vote-rigging triggered mass street protests - and its bitter aftermath over Iran's politics. After Rafsanjani's shocking disqualification in last week's election, Rowhani's candidacy became a vessel for carrying the public's message of lingering discontent.

For his part, Rowhani tactfully manoeuvred the increasingly blurry line between populism and fealty to the Islamic Republic. In televised debates with other candidates, he demonstrated a holistic understanding of Iran's troubles by exclaiming, "It is all good for centrifuges to be running, provided people's lives and livelihoods are also running." Similarly, in the company of ever-restive youth, he bemoaned the Ahmadinejad-era atmosphere of repression on university campuses and public spaces while remaining vague and noncommittal on civil freedoms or the fate of political prisoners.

In the lead-up to the election, Iranians both inside and outside of Iran, through social media and other outlets, debated the merits of participating in what essentially amounted to a fixed contest. But as election day approached, a clear consensus had emerged in favour of Rowhani. As one former activist noted on Facebook, "A vote for Rowhani represents the last best hope for maintaining our presence in the public square." The sentiment was widely shared on the eve of the election, and no doubt was the reason for his impressive margin of victory.

The supreme leader and the ultraconservative establishment were not blind to these developments. But desperate for some measure of stability after Ahmadinejad's tumultuous tenure - and reassured by the lack of genuine grassroots support for Rowhani - they resolved to let the election play out.

There is no doubt that Khamenei would have much preferred one of the more solidly conservative candidates over Rowhani (perhaps the current head nuclear negotiator and secretary-general of Iran's Supreme National Security Council, Saeed Jalili). But the conservatives' inability to unify behind a single candidate, not to mention the security establishment's determination to avoid an outcome like the one in 2009, must have forced Khamenei's hand.

This may very well afford Rowhani some measure of independence to repair the very costly public relations damage inflicted by two successive Ahmadinejad administrations. But he is unlikely to resolve long-standing public grievances against the structure of power in the Islamic Republic, as exemplified in the all-powerful office of the supreme leader and undemocratic institutions such as the Guardian Council. After all, the advent of the reform movement in the mid-1990s was largely a reaction to the arbitrary powers of the ruling elite, a fact that even Ahmadinejad and his radical supporters came to resent during his presidency.

For now, Rowhani's decisive victory represents a modus vivendi of sorts between the ruling establishment and a wily public still insistent on its rights and prerogatives. The ship of state has been steadied for the moment, but a threatening storm is already gathering.

Hussein Banai is an assistant professor of diplomacy and world affairs at Occidental College. He is co-author of "Becoming Enemies: US-Iran Relations and the Iran-Iraq War, 1979-1988." –Los Angeles Times