President Mahmoud Ahmadinejad accused Barack Obama on Thursday of behaving like his predecessor toward Iran and said there was not much point in talking to Washington unless the U.S. president apologized.

EDITORS' NOTE: Reuters and other foreign media are subject to Iranian restrictions on their ability to report, film or take pictures in Tehran.

Obama said on Tuesday he was appalled and outraged by a post-election crackdown and Washington withdrew invitations to Iranian diplomats to attend U.S. Independence Day celebrations on July 4 -- stalling efforts to improve ties with Tehran.

Mr Obama made a mistake to say those things ... our question is why he fell into this trap and said things that previously (former U.S. President George W.) Bush used to say, the semi-official Fars News Agency quoted Ahmadinejad as saying.

Do you want to speak with this tone? If that is your stance then what is left to talk about ... I hope you avoid interfering in Iran's affairs and express your regret in a way that the Iranian nation is informed of it, he said.

About 20 people have died in demonstrations following the disputed June 12 election. Police and militia have flooded Tehran's streets since Saturday, quelling the most widespread anti-government protests since the 1979 Islamic revolution.

Analysts say the battle has now moved off the street into a protracted behind-the-scenes struggle within Iran's clerical establishment, facing an unprecedented public rift.

Opposition leader Mirhossein Mousavi, who says he won the poll, has the backing of such powerful figures as former presidents Akbar Hashemi Rafsanjani and Mohammad Khatami, and senior cleric Grand Ayatollah Hossein Ali Montazeri.

Supreme Leader Ayatollah Ali Khamenei, who normally stays above the political fray, has sided strongly with Ahmadinejad.

My personal judgment is that this is a country deeply split and emotionalized, a Western diplomat in the region said.

Khamenei has upheld the result and Iran's top legislative body, the Guardian Council, has refused to annul the elections. State Press TV quoted a spokesman for the council as saying they were among the healthiest elections ever held in the country.

MOUSAVI SAYS TO KEEP FIGHTING

Mousavi said on Thursday he was determined to keep challenging the election results despite pressure to stop.

A major rigging has happened, his website reported him as saying. I am prepared to prove that those behind the rigging are responsible for the bloodshed.

He called on his supporters to continue legal protests and said restrictions on the opposition could lead to more violence.

Mousavi supporters said they would release thousands of balloons on Friday imprinted with the message Neda you will always remain in our hearts -- a reference to the young woman killed last week who has become an icon of the protests.

Obama had previously been muted in his criticism.

But on Tuesday he said that, the United States and the international community have been appalled and outraged by the threats, the beatings, and imprisonments of the last few days.

Before the election, Obama had tried to improve ties with Iran -- branded by Bush as part of an axis of evil.

Washington had been hoping to convince Tehran to drop what it suspects are plans to develop nuclear bombs, while also seeking its help in stabilising Afghanistan.

It had invited Iranian diplomats to attend Independence Day celebrations for the first time since Washington cut diplomatic ties with Tehran in 1980. The move to withdraw the invites was largely symbolic as no Iranians had even responded.

Mohammad Marandi, who is the head of North American Studies at Tehran University, said mistrust of the United States and Britain was rife.

In the short term relations will definitely get worse, but in the long term the U.S. really has to re-think its policy and to recognize that regime change is not possible in Iran.

British Foreign Secretary David Miliband said the problems came from within Iran rather than from the outside.

I think the truth is that there is a crisis of credibility between the Iranian government and their own people. It's not a crisis between Iran and America or Iran and Britain, however much the Iranian government wants to suggest that, he said.