"The result of such performance by some officials will jeopardise the pillars of the Islamic Republic and will establish tyranny."
Mr Mousavi had said there was a shortage of ballot papers and alleged that millions of people had been denied the right to vote.
His election monitors were not allowed enough access to polling stations, he added, saying he would deal seriously with any irregularities.
The head of the Committee to Protect the People's Votes, a group set up by all three opposition candidates, said the group would not accept the result, alleging fraud.
They have asked Iran's Guardian Council - a powerful body controlled by conservative clerics - to cancel the results and re-run the elections. A second opposition candidate, Mehdi Karroubi, declared the results "illegitimate and unacceptable".
Our correspondent says the result has been greeted with surprise and with deep scepticism by many Iranians.
The figures, if they are to be believed, show
winning strongly even in the heartland of Mr Mousavi, the main opposition contender.
The scale of Mr Ahmadinejad's win means that many people who voted for a reformist candidate in the previous presidential election four years ago have apparently switched their votes to Mr Ahmadinejad, he adds.
BBC Iranian affairs analyst Sadeq Saba says the result means that hope for peaceful reform in Iran may die for a long time.
There had been a surge of interest in
Iran's presidential election,
with unprecedented live television debates between the candidates and rallies attended by thousands.
There were long queues at polling stations, with turnout 85%.
Remnants of the campaign are already being removed
Four candidates contested the election, with Mohsen Razai and Mehdi Karroubi only registering about 1% of the vote each.
President Ahmadinejad draws support mainly from the urban poor and rural areas, while his rivals have support among the middle classes and the educated urban population.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.