The struggle for Iran's future may have just opened a new chapter

This was an upset, by Iranian standards, though all things are relative. Pezeshkian is a reformist and his election is a surprise.

Iran has successfully but brutally crushed a popular uprising and many had expected his hardline rival to prevail.

The presidency has control of foreign policy and some domestic matters so many expect a shift in Iran's diplomatic outlook now - perhaps a more conciliatory tone towards the West.

Read more: Reformist Masoud Pezeshkian elected Iran's new president

But any immediate race back to nuclear negotiations is unlikely and much depends on whether Trump returns to the White House.

Masoud Pezeshkian has promised a softening on the hijab or headscarf policy, but has expressed a willingness to bend to the will of the Supreme Leader Ayatollah Khamenei.

If there is change on that front, expect it to be incremental and not sudden.

Elections in Iran are not free or fair, the government strictly controls who can run. The fact Khamenei tolerated Pezeshkian's participation and victory hints at a sense of pragmatism from Iran's ultimate ruler.

Khamenei knew a miserably low turnout would be another nail in the already well-hammered coffin of his regime's legitimacy.

A slightly more "real" contest, especially in its second round, lifted numbers voting as people sensed a chance to return a reformist.

Khamenei also knows the demand for change may have been brutally crushed, but its strength of spirit remains. His government must adapt to that. A "reformist" president might ease some of the pressure.

Read more:
Ebrahim Raisi: Who was hardliner Iranian president?
Iranian protesters express 'joy' over death of President Raisi

Iran's hardliners will hope they can now neutralise the reformist agenda of the new president from within government. He faces a huge struggle now in a system where he has only limited power.

But there are risks for the elderly ailing Khamenei and the corrupt old men who form his clerical elite. Pezeshkian's victory could reignite the demand for change in a way they cannot control.

The struggle for Iran's future may have just opened a new chapter.