By entering the race, Jalili insured that the nuclear issue — which is normally taboo for public debate in Iran — would be discussed during the brief campaign. In a final televised debate a week before the elections, the other candidates harshly criticized Jalili’s stewardship of talks with the five permanent members of the UN Security Council plus Germany (P5+1).

It is too soon to say whether the election results — which gave Rouhani 18.6 million of the 37 million votes cast — will cause a swift change in Iranian policy or negotiating strategy. However, the poor showing for more conservative candidates — particularly current chief nuclear negotiator Saeed Jalili, who came in third — is too strong a signal for Iran’s leader to ignore.

Iran’s relations with the West improved significantly during the 16 years that the multilingual Rouhani was secretary of the Supreme Council for National Security. While Rouhani led talks with the Europeans from 2003 to 2005, Iran suspended elements of its nuclear program. It was only after Mahmoud Ahmadinejad became president that Iran aggressively accelerated uranium enrichment. As a result, the UN Security Council voted six times to condemn Iran, and the United States and its European allies have imposed draconian sanctions on Iranian financial institutions and oil exports.

The decisive election of Hassan Rouhani as Iran’s next president is a message to Supreme Leader Ayatollah Ali Khamenei that the majority of Iranians reject Khamenei's policy of "resistance" and confrontation with the outside world.The Supreme Leader, who told the United States on Friday to “go to hell” for disparaging Iran’s qualified democracy , is now confronted with a new chief executive best known for compromise in nuclear negotiations.

"You want to take three steps and you expect the other side to take 100 steps, this means that you don't want to make progress," he said. "This is not diplomacy. … We can't expect everything and give nothing."

During the campaign, Rouhani repeatedly noted the connection between the lack of agreement on the nuclear front and Iran’s deteriorating economy. It was nice that more centrifuges are spinning, he said, but it would be better if they were gears in Iran’s shuttered factories.

Ali Vaez, Iran analyst for the International Crisis Group, told Al-Monitor in an email “the nuclear issue became — by design or accident — a central theme in the elections. As such, the outcome will inevitably impact the country’s nuclear policy."

Vaez added, “The electoral defeat of Saeed Jalili and his narrative cannot be inconsequential. Khamenei’s bottom lines — recognition of Iran’s right to domestic enrichment and removal of sanctions — are unlikely to change. But Iran’s approach to nuclear diplomacy will."

Indeed, Rouhani will certainly insist that Iran has a right to enrich uranium, something he stressed during his tenure as chief nuclear negotiator. In an interview with this author in 2005, he said Iran wanted better relations with the United States but that it would not give up the fuel cycle nor respond positively to US threats.

Much will also depend on how the Obama administration and its negotiating partners react to Rouhani’s victory. Numerous reports this spring from influential Washington groups and think tanks have urged [US President Barack] Obama to put forward a better offer to Iran that offers significant sanctions relief in return for verifiable curbs on the Iranian nuclear program.

So far, the P5+1 has only promised to lift sanctions on Iran’s access to precious metals and exports of petrochemicals in return for stopping production of 20% uranium, sending out much of its stockpile and suspending all enrichment at an underground facility called Fordow.

With Rouhani’s inauguration in August, Jalili is likely to be replaced as secretary of the Supreme Council of National Security, and thus as Iran’s chief nuclear negotiator. The current foreign minister, Ali Akbar Salehi, an MIT-trained physicist, would be an excellent choice.

Khamenei may remain at the top in Iran’s complicated system of government but the exit of Ahmadinejad provides an opportunity for the Supreme Leader to change course before it leads to even more misery for the Iranian people and instability in a region increasingly wracked by conflict.

When he came to office in 2009, Obama famously promised to stretch out a hand if adversary nations were willing to unclench their fists. Now is the time for him to try again.

Barbara Slavin is Washington correspondent for Al-Monitor and a senior fellow at the Atlantic Council where she focuses on Iran. On Twitter: @BarbaraSlavin1