Moderate cleric Hassan Rowhani was declared Iran's new president on Saturday, the interior minister said, in an outright election victory that ends eight years of conservative grip on the top office.
Rowhani, 64, a former top nuclear negotiator who has championed more constructive engagement with world powers, won outright with 18.6 million votes, or 50.68 percent of those cast.
Announcing Rowhani's win, Interior Minister Mohammad Mostafa Najjar said 36.7 million people, or 72.7 percent of the electorate, had voted on Friday.
More than 50.5 million Iranians had been eligible to vote for a successor to Mahmud Ahmadinejad, who was constitutionally barred from standing again after serving two consecutive terms.
Rowhani's tally was enough to ensure there would be no run-off against the runner-up, Tehran Mayor Mohammad Baqer Qalibaf, who was in distant second place with 6.07 million votes.
Current nuclear negotiator, Saeed Jalili, was third with 3.17 million.
The withdrawal of the sole reformist from the race had left the field open for Rowhani to win the votes of both moderates and reformists and establish a large lead over his divided hardline opponents.
Former first vice president Mohammad Reza Aref pulled out on Tuesday at the urging of reformist ex-president Mohammad Khatami, who then threw his weight behind Rowhani.
Rowhani inherits an economy that has been badly hit by EU and US sanctions targeting the key oil and banking sectors.
Friday's election was the first since the disputed 2009 re-election of Ahmadinejad triggered massive street protests by supporters of his rivals, that were crushed in a deadly crackdown.
In 2003, when Rowhani was top nuclear negotiator under Khatami, the Islamic republic agreed to suspend its controversial enrichment of uranium.
The programme restarted two years later when Ahmadinejad was first elected.
Iran has been at loggerheads with world powers over its nuclear drive, which the West suspects is aimed at developing an atomic weapon capability.
Tehran denies the charge, but the sanctions imposed over the stand-off have isolated it internationally.
In campaigning, Rowhani pledged to move to ease the sanctions, which have led to severe economic pain.
Inflation is raging at more than 30 percent, the rial has lost nearly 70 percent of its value, and unemployment is rising.
The economy formed the focus of voters' concerns.
"We expect the new president to improve the economy so that it gets better and better," said Tehran resident Farshid Hassan Zade ahead of the results.
Rowhani also boasts close ties with moderate ex-president Akbar Hashemi Rafsanjani, and touts his relations with supreme leader Ayatollah Ali Khamenei, who has the final say on all key issues, including the nuclear programme.
Rowhani is a representative of Khamenei on the Supreme National Security Council, Iran's top security body, and was its secretary for 16 years until 2005.
He has said there will be "no surrender" to Western demands in talks on Iran's controversial nuclear programme but has promised a more constructive, less adventurist approach.
Before the official results were announced, Abbas Ali Kadkhodaei, spokesman for the Guardians Council electoral watchdog, said "no violation" had been reported.
However Ahmed Shaheed, the UN Special Rapporteur on human rights in Iran, said on Thursday that the political climate in Iran did not allow a "free and fair" election.
Tehran resident Ali Yousefi said after voting on Friday: "I think that there was a great level of participation in this election, which shows that people will show up when they should and turn everything to their favour."
The 2009 protests that followed Ahmadinejad's re-election led to the eventual detention under house arrest of opposition candidates Mir Hossein Mousavi and Mehdi Karroubi, and the widespread suppression of reformists.
Khatami's endorsement of Rowhani for president gave birth to an online movement, with social networkers urging abstentionists not to waste their votes.
Rowhani has vowed to restore diplomatic ties with arch-foe the United States, which cut relations in the aftermath of the 1979 seizure of the US embassy by Islamist students.
He has also pledged that "discrimination against women will not be tolerated".
Married with four children, he holds a doctorate in law from Scotland's Glasgow Caledonian University, according to his official CV.
He was born in 1948 in the town of Sorkheh southeast of Tehran.