Mahmoud Ahmadinejad was officially returned for a second term
Iran's top electoral body, the Guardian Council, has confirmed the victory of Mahmoud Ahmadinejad in the presidential election after a partial recount.
News of the decision, which comes after a series of protests by the opposition against what it says was a rigged ballot, was announced by state TV.
The 12-strong council is the most influential body in Iran and is currently controlled by conservatives.
Some 17 people are thought to have died during opposition street protests.
"The secretary of the Guardian Council in a letter to the interior minister announced the final decision of the Council... and declares the approval of the accuracy of the results of... the presidential election," the state broadcaster said.
A partial recount of the election carried out on Monday showed no irregularities in the vote, Iran's English-language Press TV television station added, according to Reuters news agency.
Mr Ahmadinejad was officially re-elected with 63% of the vote on 12 June.
His main challenger, Mir Hossein Mousavi, has said the whole election should be annulled and held again.
Reports say there were clashes on Monday in central Tehran between opposition demonstrators trying to form a human chain and security forces.
The Guardian Council had ruled earlier that any irregularities in the polling would not affect the result of the election.
For many Iranians the latest ruling confirming Mr Ahmadinejad's victory was seen as rubber-stamping fraud, says the BBC's Jeremy Bowen in Tehran.
Iran's crisis since the presidential election has taken the Islamic Republic into new and unknown territory, our correspondent says.
All sorts of red lines have been crossed, with unprecedented public condemnation of the supreme leader, Ayatollah Ali Khamanei, he adds.
Iran has been left with a divided ruling elite that has been having a public quarrel, our correspondent says.
During the mass rallies a broad-based opposition coalition emerged.
It did not have effective leadership so the authorities were able to take the initiative back, helped by a security crackdown and hundreds, some say several thousand, arrests.
The people who took to the streets are still angry about what happened, our correspondent adds, and the authorities must fear that anger, because it could explode again.