The landslide win by moderate Hassan Rowhani was driven largely by voters frustrated with Iran's sagging economy and his unexpected adoption of the reformist cause.

TEHRAN — The stunning landslide election of Hassan Rowhani as Iran's next president highlighted a deep frustration among many Iranians about the direction of their country, especially an economy marred by skyrocketing prices, stagnant salaries and dwindling job opportunities.

In explaining their vote for Rowhani, many spoke of change. They alluded not to hot-button international issues such as Iran's contentious nuclear program or its die-hard support of Syrian President Bashar Assad, but to the slumping economy that has been especially unforgiving on the young, among whom the unemployment rate reportedly tops 40%.

"People want a change in the economic situation," said Saman Hasani, 26, an engineering student who was among many people honking car horns on the streets of Tehran on Saturday evening after the Interior Ministry confirmed Rowhani's victory. "They want to see some economic growth, less unemployment."

As Rowhani's unlikely victory began to sink in Saturday evening, thousands of people congregated on the streets of Tehran, and impromptu celebrations erupted. Security personnel made no move to rein in the festivities.

Jubilant marchers clapped in unison and waved banners in purple, the color of the victor's campaign. "Long live Rowhani!" they shouted.

As the only perceived moderate in the race, and as the establishment's least-favorite among the six candidates, Rowhani had a natural appeal for those seeking a new direction after eight years of President Mahmoud Ahmadinejad, widely seen as a divisive and bombastic figure who alienated many and, according to his critics, badly mismanaged the economy.

Rowhani's economic prescriptions weren't especially original: create jobs by bolstering domestic industry and attracting foreign investment. But he linked economic development with an ambitious, albeit somewhat inchoate, project for "reconciliation with the world," hinting at a global engagement for a nation that has become isolated and shut off from foreign markets.

"I believe solving the economic issue is possible through foreign policy," he said at one point, a comment that seemed to offer new vistas for a population starved for possibilities.

Rowhani's reputation has long been that of a slightly conservative but pragmatic cleric with deep roots in the 1979 Islamic Revolution. Far from a firebrand, he has been a mainstay of post-revolutionary Iranian politics. He served for years in the parliament and as the top nuclear negotiator for President Mohammad Khatami, a reformist often stymied by Iran's entrenched alliance of the clerical elite and the Islamic Revolutionary Guard Corps and its massive economic tentacles.

The fact that the powerful Guardian Council, which vets candidates, allowed Rowhani to stay on the presidential ballot while barring his mentor, former President Ali Akbar Hashemi Rafsanjani, was a sign that he was not seen as a threat to the system.

But Rowhani enthusiastically and unexpectedly embraced the reformist cause, whether out of pure conviction or some measure of political expediency. He took on such incendiary issues as individual rights, gender equality, artistic freedom and censorship.

"I think artists should decide themselves how to handle their professions," he said at one point, a perilous suggestion in an authoritarian government profoundly paranoid about what its citizens are up to.

Rowhani the cautious centrist seemed to attain an almost overnight charisma, his standing bolstered when the one true reformer in the race dropped out last week in an opposition maneuver to unify forces against a fractured array of hard-line candidates.

Meanwhile, Rowhani's musings about freedoms and opening up society resonated with important constituencies: the young, women and members of the urban middle class fed up with official slogans and a weekly struggle to pay the bills. He hinted at releasing political prisoners, declaring at one point, "Why should people be in jail just for their ideas?"

His comments were measured and often nonspecific, clearly designed not to confront the leadership but to connect with the disillusioned quiet majority. His religious pedigree — he was the only cleric among the six candidates — probably provided some cover. Final results showed that he ran well in the seminary city of Qom, indicating an affinity with certain religious conservatives.

His chief rivals in the conservative bloc necessarily hewed to a more limited vision that seemed more of the same.