Mahmoud Ahmadinejad has won a crushing victory in Iran's landmark presidential election, according to the country's authorities, but his moderate challenger Mir Hossein Mousavi has warned of "tyranny" and protested that the result was rigged after a record turnout of 84%.

As the official results were announced, baton-wielding riot police clashed with angry Mousavi supporters in some of the most serious unrest Tehran has seen in years.

Riot police on motorbikes used batons to disperse Mousavi supporters who staged a sit-in near the interior ministry, where the results were announced. Up to 2,000 Mousavi supporters erected barricades of burning tyres and chanted "Mousavi take back our vote! What happened to our vote?"

Reporters saw police attacking the demonstrators, and several protesters were carried away. The BBC showed footage of police attacking protesters, some of whom threw stones at the officers.

In another main street of Tehran, about 300 young people blocked the avenue by forming a human chain and chanted "Ahmadi, shame on you. Leave the government alone."

Mobile phone text messages were jammed, and news and social networking websites – including the Guardian, the BBC and Facebook – as well as pro-Mousavi websites were blocked or difficult to access.

"The election was a game and full of lies," shouted one protester. "We can not do anything here," said another. "We can not believe the results and they are unacceptable."

Mousavi appealed directly to Ayatollah Ali Khamenei but the country's supreme leader today threw his weight behind Ahmadinejad, urging the other candidates to support the president.

Mousavi said this morning: "I personally strongly protest the many obvious violations and I'm warning I will not surrender to this dangerous charade. The result of such performance by some officials will jeopardise the pillars of the Islamic Republic and will establish tyranny."

But Khamenei, who has final say on all state matters, called the result a "divine assessment" and called on all Iranians to support Ahmadinejad.

Speaking on state television this afternoon, he said: "I assume that enemies intend to eliminate the sweetness of the election with their hostile provocation."

Mousavi, a former prime minister, had been widely expected to trounce the controversial incumbent, or at least do well enough to trigger a run-off. He claimed victory in an apparent attempt to pre-empt his rival.

But as the votes were still being counted late on Friday, aides to Ahmadinejad announced that he had won by an "unassailable" margin. Polling stations had stayed open four extra hours to meet the huge demand.

The interior minister, Sadeq Mahsouli, said this afternoon that Ahmadinejad had won an overwhelming victory of 62.63% to Mousavi's 33.75%.

Even in Mousavi's hometown province of Tabriz in north-west Iran, the ministry claimed Ahmadinejad received more than 60% of the vote.

Early editions of Mousavi's paper Kalemeh Sabz, or the Green Word, and other reformist dailies declared Mousavi the victor but were ordered to change their headlines, local journalists said. The papers had blank spots where articles were removed.

The outcome seems a grave setback to hopes for a solution to the looming international crisis over Iran's nuclear ambitions and for détente with the US in response to Barack Obama's overtures. Israel quickly demanded efforts to stop Iran acquiring nuclear weapons.

"It doesn't augur well for an early and peaceful settlement of the nuclear dispute," said Mark Fitzpatrick at London's International Institute for Strategic Studies.

Israel's deputy foreign minister, Danny Ayalon, said: "If there was a shadow of hope for a change in Iran, the renewed choice of Ahmadinejad expresses more than anything the growing Iranian threat."

If the result stands it will spell an end to hopes for the greater freedoms and economic competence Mousavi had promised Iran's 72 million people. At times the election campaign seemed like a referendum on Ahmadinejad's four-year term.

The high turnout underscored the stakes domestically. Mousavi's slick ­campaign galvanised an apathetic electorate and raised hopes of a more stable economy and increased liberty at home as well as better relations abroad.

Supporters had hoped Mousavi could have a similarly positive effect to Mohammad Khatami, who ushered in a period of change that ended when Ahmadinejad came from nowhere to capture the presidency four years ago.

Trita Parsi, the president of the Washington-based National Iranian American Council, expressed disbelief at the wide margin in Ahmadinejad's favour. "It is difficult to feel comfortable that this occurred without any cheating," Parsi told Reuters.

Ali Ansari, who heads the Institute for Iranian Studies at St Andrews University in Scotland, warned: "The potential for unrest is high."

As three weeks of often passionate campaigning drew to a close on Wednesday, the powerful Islamic Revolutionary Guard Corps (IRGC) issued an ominous warning that any attempt at a popular "revolution" would be crushed.