Hassan Rohani’s election victory took many commentators by surprise. But the call for a move towards the centre, for e‛tedal (‘moderation’), has been in the air in Iran for a couple of years. In fact, all but one of the six candidates on the ballot on election day would one way or another have tried to pull the country away from the highly polarising politics that have dominated since Ahmadinejad’s re-election in 2009, and the protests and harsh crackdown that followed.

Still, there was nothing inevitable about the way Rohani was elected. When the Guardian Council announced last month that Akbar Hashemi Rafsanjani, the former president and icon of centrist politics in Iran, was disqualified, the country responded with shocked silence. But the complacency did not last long. Pressure from below forced those at the top of the centrist and reformist camps – notably Rafsanjani and his successor as president, Mohammad Khatami – to reconsider their inaction. Khatami asked the reformist candidate Mohammad Reza Aref to withdraw and give his backing to Rohani. And with their alliance in support of the centrist candidate, the mood of the country changed. There was still the question, for reform-minded Iranians, of whether or not to vote at all. In the event, despite realistic concerns about vote-rigging, hope overcame cynicism. Turnout was 72.7 per cent, and Rohani got almost 51 per cent of the vote.

Fear, as well as hope, had a part in his victory: fear, first, of Saeed Jalili, the chief nuclear negotiator and most hardline candidate. His rhetoric, full of talk of martyrdom and Islamic purity, is reminiscent of the years of war with Iraq. Jalili denied that he would be another Ahmadinejad, but many Rohani voters thought he might be even worse – a real believer. Fear played itself out in another way, too. For voters worried by the example of Syria’s descent into civil war, and the possibility that Iran might follow it, moving the country away from the ‘extremism’ that Jalili represented was more than a desire; it was an existential necessity.

Rohani’s stance of moderation and prudence sets the right tone for a country facing a ferocious sanctions regime and wracked with domestic tensions. No doubt, his promises of economic recovery, improved external relations and greater freedoms at home are a tall order. He will have to negotiate between the demands of supporters pushing for faster change – Mir Hussein Mousavi’s Green Movement is far from a spent force – and the resistance of many institutional players, not least Ayatollah Khamenei. He will also be facing external powers which may continue to increase the pressure on Iran rather than relieve it.

Comparisons to the period when reformists took control of the executive branch, under Khatami’s presidency (1997-2005), are misplaced. Iranians have had a decade to reflect on the reasons for the failures and successes (as well as the excesses) of the reform period. We shouldn’t forget that 49 per cent voted for conservative candidates, though there was no mistaking the beating the hardliners took at the polls, with Jalili receiving only 11.3 per cent.

On the day before the election, Hossein Shariatmadari, the editor of the hardline daily Kayhan, wrote an editorial lambasting Rohani for cavorting with reformist seditionists and enemies of Iran. The day after the results were announced, Shariatmadari declared Rohani the president of all Iranians, and called for ‘rivalries to turn into friendships’. The period of conciliation will not last long. But this may still be the most important election in the Islamic Republic’s history, because it has reminded people that it is after all possible to express popular opinion through elections.