TEHRAN — After many Iranians skipped voting in Friday’s presidential election, seeing it as rigged in favor of an ultraconservative contender, that candidate — the hard-line judiciary chief, Ebrahim Raisi — won Iran’s presidency on Saturday, paving the way for the country’s leadership to cement the conservative legacy of the supreme leader, Ayatollah Ali Khamenei.
Mr. Raisi, 60, a cleric favored by Ayatollah Khamenei, has been seen as the supreme leader’s possible successor. With his election, the ayatollah will finally have a president all but guaranteed not to challenge him, leaving the urban middle classes who have consistently supported social reforms and engagement with the outside world with no voice at the top.
Mr. Raisi has a record of grave human rights abuses, including accusations of playing a role in the mass execution of political opponents in 1988, and is currently under United States sanctions.
Yet his background appears unlikely to hinder the renewed negotiations between the United States and Iran over restoring a 2015 agreement to limit Iran’s nuclear and ballistic missile programs in exchange for lifting American economic sanctions. Mr. Raisi has said he will remain committed to the deal and do all he can to remove the sanctions.
“With the people trusting me, there is great responsibility on my shoulders, and I will try my very best, with the help of God and the Prophet and his descendants,” Mr. Raisi said at a news conference on Saturday. “I hope I can fulfill the heavy burden of duty on my shoulders.”
The Interior Ministry said on Saturday that Mr. Raisi had won with nearly 18 million of 28.9 million ballots cast in the voting a day earlier. Turnout was 48.8 percent — a significant decline from the last presidential election, in 2017, when the country’s moderate- and liberal-leaning voters powered the re-election of President Hassan Rouhani, a centrist pragmatist whose administration negotiated the first nuclear deal with the United States.
Many of those same voters sat out this election, saying that the campaign had been engineered to put Mr. Raisi in office or that voting would make little difference no matter the winner, moderate or conservative. He had been expected to win handily despite late attempts by the more moderate reformist camp to consolidate support behind their main candidate — Abdolnaser Hemmati, a former central bank governor.
In the end, the fracturing of the reformist camp and disgust with Mr. Rouhani, who could only watch as President Donald J. Trump withdrew from the nuclear deal and reimposed sanctions in 2018, resulted in a weak showing for moderates.
The Interior Ministry said Mr. Hemmati came in third with around 2.4 million votes, after the second-place finisher, Mohsen Rezaee, a former commander in chief of Iran’s powerful Revolutionary Guards Corps, who won around 3.4 million votes.
There were also about 3.7 million “white” ballots, or ballots cast without any candidate’s name written in. Some Iranians said they turned in white ballots as a way of exercising their right to vote while protesting the lack of candidates who represented their views.
“This is the first government that is entirely beholden to Ayatollah Khamenei,” said Ali Vaez, the Iran director for the International Crisis Group. “Khamenei has created a situation that is exploiting the sense of indifference and helplessness within the society to usher in changes that he thinks are essential for his legacy.”
Those changes may even include profound shifts to the structure of the Islamic Republic, such as moving from electing a president to appointing a prime minister.
To his supporters, Mr. Raisi’s close identification with the supreme leader, and by extension with the Islamic Revolution that brought Iran’s clerical leaders to power in 1979, is part of his appeal. Campaign posters showed Mr. Raisi’s face alongside those of Mr. Khamenei and his predecessor, Ayatollah Ruhollah Khomeini, as well as Maj. Gen. Qassim Suleimani, the Iranian commander whose death in an American airstrike last year prompted an outpouring of grief and anger among Iranians.
Mr. Raisi’s supporters also cited his résumé as a staunch conservative, his promises to combat corruption, which many Iranians blame as much for the country’s deep economic misery as American sanctions, and what they said was his commitment to leveling inequality among Iranians.
Hundreds of Raisi voters gathered in Imam Hussain Square in a working-class district of eastern Tehran on Saturday evening to celebrate the victory, waving Iranian flags as a singer and a boys’ choir sang patriotic anthems to the crowd. Fireworks burst from the roof of a small rotunda that houses the tombstones of several Iranian martyrs; women ululated in celebration.
“Rouhani is leaving, hurrah, hurrah,” a passing motorcyclist sang, referring to the departing president.
Those at the rally said they were pleased enough with Mr. Raisi’s victory.
But overall, voter turnout was low despite exhortations from the supreme leader to participate and a get-out-the-vote campaign that appealed to Iranians’ patriotism and played on their fears: One banner brandished an image of General Suleimani’s blood-specked severed hand, still bearing his trademark deep-red ring, urging Iranians to vote “for his sake.” Another showed a bombed-out street in Syria, warning that Iran ran the risk of turning into that war-ravaged country if voters stayed home.
Voting was framed as not so much a civic duty as a show of faith in the Islamic Revolution, in part because the government has long relied on high voter turnout to buttress its legitimacy.
Though never a democracy in the Western sense, Iran has in the past allowed candidates representing different factions and policy positions to run for office in a government whose direction and major policies were set by the unelected clerical leadership. During election seasons, the country buzzed with lively candidate forums, policy debates and competing rallies.
But since protests broke out in 2009 over charges that the presidential election that year was rigged, the authorities have gradually winnowed down the confines of electoral freedom, leaving almost no choice this year.
Many prominent candidates were disqualified last month by Iran’s Guardian Council, which vets all candidates, leaving Mr. Raisi the clear favorite and disheartening relative moderates and liberals, who had — and now have — no one behind whom to unite.
Analysts said that the supreme leader’s support for Mr. Raisi could give him more power to promote change than the departing president, Mr. Rouhani. Mr. Rouhani ended up antagonizing the supreme leader and disappointing voters who had hoped he could open Iran’s economy to the world by striking a lasting deal with the West.
The prospects for a renewed nuclear agreement could improve now that the election is over. Mr. Khamenei, who steers the nuclear negotiations and has the last word on all important matters of state, appeared to be stalling the current talks as the election approached. But American diplomats and Iranian analysts said that there could be movement in the weeks between Mr. Rouhani’s departure and Mr. Raisi’s ascension.
However, Mr. Raisi’s conservative views may make it more difficult for the United States to reach additional deals with Iran and extract concessions on critical issues such as the country’s missile program, its backing of proxy militias around the Middle East and human rights.
The conservative Iranians who turned out for Mr. Raisi, many of whom regard the West with suspicion, are not necessarily against a renewed deal, given how much Iran stands to benefit from ending sanctions. But, some said in interviews, they will back negotiations only if the United States shows it will follow through on its commitments — unlike the last time.
If negotiations go well, Masoud Mohamadi, 52, an electrical engineer with relatives in the United States, said he hopes to use his American contacts to do business deals.
“But my pride will not allow me to go for this just for my own benefit,” he said at Mr. Raisi’s victory rally on Saturday. “America has once shown that it’s unreliable and untrustworthy. If they lift all the sanctions first, then we’ll go back into compliance, too.”
Farnaz Fassihi contributed reporting from New York.