An Iranian voter with the inked finger that shows she has cast her ballot in the country's presidential elections. Photograph: Ahmad Halabisaz/Xinhua Press/Corbis
Predicting the outcome of Iranian presidential elections is notoriously difficult – Mahmoud Ahmadinejad was virtually unknown when he won his first term in 2005. But aside from the near certainty of surprises the only other constant is that the outside world will be hoping to see different policies from whoever replaces the unlamented incumbent. Satisfaction is far from guaranteed.
Surging support for the cleric Hassan Rouhani over the past few days has been a salutary reminder of the volatility of these races. Under Iran's hybrid political system presidential candidates are vetted on the authority of the theocratic "supreme leader" but chosen by popular vote.
The country's reformists are still battered and bruised – their two candidates in 2009 remain under house arrest – but supporters of the "Green" movement who believe they were robbed last time are still there and anxious to see better times.
Appearances count for a lot. The Iranian establishment has worked hard to forestall the sort of mass protests that followed the disputed election four years ago – not least because since then the world has witnessed the Arab uprisings (Tehran has relished portraying them as an "Islamic awakening") as well as the unrest in neighbouring Turkey.
Restrictions on the internet and domestic and foreign media are part of this preventive strategy. Turnout, always seen as important to underline the democratic legitimacy of the Islamic Republic in the face of its enemies at home and abroad, will matter too – though very large numbers are likely to favour the more moderate candidates.
Whoever becomes president, however, will face a familiar set of pressing domestic and international issues. The biggest one is the economy, battered by tightening sanctions imposed by the US to apply pressure over stalled nuclear negotiations. Iran's economy faces severe and long-standing structural problems that have been aggravated by the sanctions – even if it remains a taboo to link the two explicitly. Exchanges between the leading candidates on this point have been coded but unmistakable. It is clear, however, that the big issue is that of Iran's isolation in the wider world – the point on which the clownish and provocative Ahmadinejad aroused most anger.
It was striking that Ali Akbar Salehi, the foreign minister, declared as he cast his vote that he hoped for improved relations with the US – a handy reminder that, revolutionary ideology aside, many Iranians still admire America. Making precisely the opposite point, the Supreme Leader himself – who at 74 seems unlikely to temper his hostility to the country which engineered the overthrow of Mossadegh and backed the shah – lashed out at Washington. "To hell with you if you do not believe in our election!" said Ayatollah Ali Khamenei. It was a blunt response to comments by US officials that they do not have "high expectations" that the election will change "the fundamental calculus of Iran".
That certainly seems true of Saeed Jalili, the hardliner and current nuclear negotiator who is seen as Khamenei's personal choice. But would a different winner, Rouhani or Mohammed Bagher Qalibaf, the technocratic mayor of Tehran, display more flexibility to win support among young Iranians (a third of the 50-million-strong electorate are under the age of 30) though that could risk the opposition of the powerful Revolutionary Guards, the loyal keepers of Khomeini's flame? Maybe. But on the international issues it still seems unlikely. "Whoever wins will be very limited in their ability to influence foreign and nuclear policy," warns Ali Ansari of St Andrews University.
Expectations in the west, then, are sensibly low. But if there is to be change for the better in Iran after this election it could perhaps come in a new and better-functioning relationship between Khamenei and the president after the ructions of the Ahmadinejad years – his departure at least bringing audible sighs of relief from his many enemies.