A supporter of Iran's new President-Elect Hassan Rohani flashes a victory sign as she holds his poster during a post-election celebration in Tehran, Iran, Saturday, June 15, 2013. Moderate cleric Hassan Rohani was declared the winner of Iran's presidential vote on Saturday after gaining support among many reform-minded Iranians.

Istanbul — Politically moderate cleric Hassan Rohani won a first-round victory in Iran’s presidential election, a stunning result that heralds change – both in tone, and almost certainly in substance – for the Islamic Republic.

Mr. Rohani, a former nuclear negotiator, polled three times as many votes as his nearest rival to garner 50.71 percent of all ballots cast, enough to avoid an expected runoff. He faced down a host of conservatives in Friday’s vote, stating at the ballot box that he had “come to destroy extremism.”

Rohani built his campaign around promises to ease Iran’s tensions with the West, end international sanctions, allow greater freedom of the press and reduce government interference in private lives. Ahead of the vote many said that Rohani’s candidacy was little more than window dressing, permitted by Iran’s Supreme Leader Ayatollah Ali Khamenei to boost turnout among disillusioned Iranians and erase memories of the violent, fraud-tainted 2009 election.

But with the cleric now officially Iran's president-elect, after capitalizing on discontent within the electorate and divisions in the conservative camp, Khamenei may be as surprised as anyone about the result. The surge for Rohani began just 72 hours before the vote – fueled by endorsements from former presidents Mohammad Khatami and Akbar Hashemi Rafsanjani – and has now shocked Khamenei and the rest of the conservative establishment.

There is shock, too, for all those Iranians who planned to boycott the election because they considered their votes “useless” in a rigged system, yet voted anyway – pushing official turnout to roughly 72 percent – and found their choice accurately reflected in the result.

“The Climax of a Political Epic – World was Stunned Again,” proclaimed the hardline Kayhan newspaper. One Iranian Tweet distilled the surprise: “Four years ago today we were on the street in disbelief, chanting ‘Where is my vote?’ This is a different kind of disbelief.”

Khamenei had called for a large turnout to defeat Iran’s “enemies,” and to restore legitimacy to an Islamic system tarnished by Iran's fraud-tainted 2009 election, which brought millions of Iranians to the streets in weeks of protest that were violently crushed amid chants of “Death to the Dictator!”

Iranian pendulum

“What we are seeing is a swing of the pendulum, with a clear understanding of what happened before,” says Farideh Farhi, an Iran expert at the University of Hawaii. Critical was the ability of Mr. Khatami and Mr. Rafsanjani to work together, “prodded by…the rank and file in the provinces” to do something “no matter how flawed [the election] is."

“Once they became convinced that conservative forces have a stake in running an adequately fair election – a proper election, in terms of its mechanism – then the game became extremely political and strategic. It worked, and one has to give kudos to two former presidents who now are leaders of the country, because they have proven they can mobilize voters,” she says.

In the months prior to the vote, the regime insisted that the “sedition” of 2009 would not be repeated. Journalists were arrested or harassed months ago. Revolutionary Guard commanders issued warnings against interference at home and abroad.

The 686 people who registered to run were whittled down to just eight candidates by the Guardian Council, which disqualified Rafsanjani as well as the chosen successor of President Mahmoud Ahmadinejad, whose second term ends in August.

Khamenei and other elements of the ruling system made clear their preference that one of the six hardline contenders should win. Among them are the popular Tehran mayor Mahammed Baqr Qalibaf and current nuclear negotiator Saeed Jalili. Against such well-known opponents close to the Supreme Leader, Rohani was given little hope.

But events combined to provide the “hope” and “prudence” that were the catchwords of his campaign. Conservatives were divided, their votes split among themselves. And after a third televised debate – in which Rohani claimed he had “never lied” to the Iranian people – fellow reformist candidate Mohammad Reza Aref withdrew from the race. High-profile endorsements began to pile-up and Rohani began to ride the crest of a popular surge.

Today she marvels that the vote count was “so measured and meticulous” compared to 2009, and quipped that her “jaw is hurting from repeated falling motion, chest getting bruised... this election is merely an indication that maybe the Leader is feeling less bloody-minded after learning a hard lesson through his selection of Ahmadinejad [in 2005 and 2009] and is now ready to be more pragmatic to save the Islamic system."

Hardliners and blame

Hardliners did not blame Khamenei for the result, but in some cases themselves. An editorial today in Tabnak, which is run by candidate and former Revolutionary Guard commander Mohsen Rezaei, explained the loss under the headline: “Why is defeat necessary?"

“People of Iran said no to fundamentalists because they were unhappy about the way the country was being managed and were hurt because of it,” Tabnak said. Iranians wanted a president who “does not only chant slogans inside and outside Iran and bring fundamentally negative changes to their lives.”

Votes were counted far more slowly than in 2009, when complete results were published by a semi-official news agency while the polls were still open, then taken down only to be re-posted with precisely the same numbers later.

The reformist candidates in that election, Mir Hossein Mousavi and Mehdi Karroubi, leaders of the so-called Green Movement who challenged the 2009 result and Khamenei, remain under house arrest in Tehran. The Supreme Leader said today’s result would help overcome the ghosts of 2009. Khamenei did not speak as ballots were being counted, but his office tweeted: “In 2009 was same excitement but w/ insults; this election has no disrespect. It’s valuable that we’ve progressed so much in 4 years.”

In another tweet, Khamenei said: “2009 unrests were all about to hurt [popular] base of Revolution while West propagandized 'people lost confidence.' No! People & System got mutual confidence.”

Rafsanjani appears to agree with him. Iranian media quoted the former president today saying it was the “most democratic election in the world and there are not flaws in the election.”

Gracious in victory and defeat

Overnight all six candidates issued a joint statement calling on their supporters not to demonstrate or make celebrations until the results were out. By late afternoon, Rohani had called on his supporters not to “gather against the law,” and that any gathering would only be after official announcements and with legal permission.

“If this result stands, the Western narrative stating that Ayatollah Ali Khamenei and the [Revolutionary Guard] are all-powerful needs to be revisited,” wrote Trita Parsi, president of the National Iranian American Council, in an analysis from Washington. “Though hardliners remain in control of key aspects of Iran’s political system, the centrists and reformists have proven that even when the cards are stacked against them, they can still prevail due to their support among the population."

Mr. Parsi wrote that “Rohani will likely try to move to the middle now and be a unifying president.”

As voting was extended by five hours on Friday, there were noticeable differences compared to 2009. State TV channel IRIB broadcast that candidate representatives were allowed to stay in polling stations until the counting was done. The head of the election headquarters Seyed Solat Mortazavi last night said he would look into reports of Jalili campaign material being distributed at polling stations and “we will confront such behavior.” Journalists were not kicked out of the Interior Ministry as results were coming in, as they were in 2009.

“Now because people are so shocked, they think that Mr. Khamenei has planned all these things to reinvent the Islamic system,” says Farhi in Hawaii. Instead, the results illustrate that there is “real politics going on [across] contested political terrain” in Iran, which shows the limits of Khamenei’s ability to shape events. “The Islamic Republic has developed so many competing institutions, and competing political forces” that the consolidation of conservatives since 2005 was not likely to last, says Farhi.

“The policies of the last eight years so clearly failed, in terms of improving the lot of the Iranian population, that now there is an adjustment. If it didn’t happen, then there was something wrong.”

Yet Khamenei would have been as surprised as any at the Rohani victory. “[Khamenei] is the leader who made the decision in 2009 to come out and say publicly that his views are closer to Ahmadinejad. He identified himself not as the father of the nation, but as player in these things,” adds Farhi. “So he is paying for that political mistake,” she says. “Does this mean that he’s going to disappear, and the office of the Leader is not going to be powerful anymore? Absolutely not.”

(This story was updated after first posting to show that Rohani had won).