Hassan Rouhani wins Iran presidential election
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.
- Hassan Rouhani: 18,613,329
- Mohammad Baqer Qalibaf: 6,077,292
- Saeed Jalili: 4,168,946
- Mohsen Rezai: 3,884,412
- Ali Akbar Velayati: 2,268,753
- Mohammad Gharazi: 446,015
- Votes cast: 36,704,156
"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.
Ayatollah Khamenei will ratify the vote on 3 August and the new president will then take the oath in parliament.
Mr Rouhani, who has pledged greater engagement with Western powers, said: "This victory is a victory for wisdom, moderation and maturity... over extremism."
But he also urged the world to "acknowledge the rights" of Iran.
He said: "The nations who tout democracy and open dialogue should speak to the Iranian people with respect and recognise the rights of the Islamic republic."'Different course'
Interior Minister Mostafa Mohammad Najjar announced that Mr Rouhani had won 18,613,329 of the 36,704,156 votes cast. This represented 50.71% of the vote.
Tehran Mayor Mohammad Baqer Qalibaf won 6,077,292 votes to take second place (16.56%).
At the scene
Minutes after the announcement of the final result of the election, people in Tehran showed their happiness by pouring on to the streets. Standing on the roof of the BBC building in northern Tehran, I could hear cars blowing their horns and some people cheering.
On the phone a friend excitedly told me how people had left their cars and were walking toward Vali-Asr Square in central Tehran, which has witnessed many of Mr Rouhani's rallies in the past 10 days.
The reaction of the people showed how much they trusted the electoral system, after there had been much debate within the opposition about whether to boycott the election or take part.
Ayatollah Ali Khamenei sent a message of congratulations to the people and called them the real winners of the election. Iran's supreme leader had urged everyone - even those who do not like the Islamic system but love their country - to vote.
Saeed Jalili came third and Mohsen Rezai fourth.
Mr Najjar said that any challenge by presidential candidates would have to be lodged to the Guardian Council within three days.
The winning candidate needed more than 50% of all ballots cast, including invalid ones, to avoid a run-off.
Crowds gathered in Vali-Asr Square in central Tehran and in Kaj Square in the north-west of the capital to hail the victory.
"Long live reform, long live Rouhani," members of the crowd chanted.
One of them told Reuters news agency: "Many people are holding Rouhani posters. Some are hugging and crying. We are all so happy here. We can't believe there is finally a change."
The US said it respected the vote, although White House spokesman Jay Carney cited concern at censorship and lack of transparency.
The US would "engage Iran directly" to find a "diplomatic solution that will fully address the international community's concerns about Iran's nuclear programme".
The UK Foreign Office urged Mr Rouhani to "set Iran on a different course for the future: addressing international concerns about Iran's nuclear programme... and improving the political and human rights situation for the people of Iran".
France said it was "ready to work" with the new leader.
End Quote Arash Ahmadi and Amara Sophia Elahi BBC Monitoring
The question now remains: Will the hardline establishment recognise the message of change that the electorate have sent them?”
One of Mr Rouhani's main pledges was to try to ease international sanctions imposed on Iran over its nuclear programme.
Iran has been suffering economic hardship, with rising unemployment, a devalued currency and soaring inflation.
BBC diplomatic correspondent Jonathan Marcus says Mr Rouhani's election is not necessarily the moment for a substantive change in Iran's policy, but that even a change in style might offer an opening to the US and key UN Security Council members which would be worth testing for any real sign of flexibility in Tehran.Endorsement
Voting had been extended by five hours on Friday evening to allow more people to cast their ballots.
Although all six candidates were seen as conservatives, analysts say Mr Rouhani - a 64-year-old cleric often described as "moderate" who has held several parliamentary posts and served as chief nuclear negotiator - has been reaching out to reformists in recent days.
- A religious moderate, fluent in English, German, French, Russian and Arabic
- The only cleric contesting the Iranian presidential election
- Key figure in Iranian politics who has held some of the country's top jobs, including chief nuclear negotiator
- Has the backing of two former presidents
The surge of support for him came after Mohammad Reza Aref, the only reformist candidate in the race, announced on Tuesday that he was withdrawing on the advice of pro-reform ex-President Mohammad Khatami.
Mr Rouhani thus went into polling day with the endorsement of two ex-presidents - Mr Khatami and Akbar Hashemi Rafsanjani, who was disqualified from the race by the powerful Guardian Council, a 12-member body of theologians and jurists.
The hardline candidates included Mr Qalibaf - who is seen as a pragmatic conservative - and nuclear negotiator Mr Jalili - who is said to be very close to Ayatollah Khamenei.
The other three candidates were Mr Rezai, a former head of the powerful Revolutionary Guards, former Foreign Minister Ali Akbar Velayati, and former Telecommunications Minister Mohammad Gharazi.
After the last presidential election in June 2009, millions of Iranians took to the streets to demand a rerun, when the supreme leader dismissed claims by the three defeated candidates of widespread fraud.
No foreign observers monitored this year's election and there have also been concerns that media coverage in the run-up has been unfair.
Many reformist newspapers have been shut down, access to the internet and foreign broadcasters has been restricted, and journalists have been detained.