Reformist-backed cleric Hassan Rouhani has won Iran's presidential election, securing just over 50% of the vote and so avoiding the need for a run-off.
Crowds gathered in Tehran to hail Mr Rouhani, who said he had achieved a "victory of moderation over extremism".
Some 72.2% of the 50 million eligible Iranian voters cast ballots to choose the successor to Mahmoud Ahmadinejad.
The US said it was "ready to engage directly" with Iran over its disputed nuclear programme.
Supreme Leader Ayatollah Ali Khamenei congratulated Mr Rouhani on his victory.
"I urge everyone to help the president-elect and his colleagues in the government, as he is the president of the whole nation," he said.
If there is any such thing as a country that you would think would hate war and conflict,it would be Iran. People under 40 can look around and see virtually nobody alive from previous generations. Even the ones in their 40's are thin on the ground,from serving as land-mine detectors as children under Khomeini.
Why is democracy held in such high esteem when it’s the enemy of the minority and makes all rights relative to the dictates of the majority? (Ron Paul,2012)