The power struggle inside Iran appears to be moving from the streets into the heart of the regime itself this weekend amid reports that Ayatollah Hashemi Rafsanjani is plotting to undermine the power of Supreme Leader Ayatollah Ali Khamenei. Rafsanjani's manoeuvres against Khamenei come as tensions between the speaker of the parliament, Ali Larijani, and President Mahmoud Ahmadinejad also appeared to be coming to a head.

Mass demonstrations on the streets against the election results have been effectively crushed by a massive police and basiij militia presence that has seen several dozen deaths and the arrests of hundreds of supporters of defeated candidate Mir Hossein Mousavi. But the splits within Iran's political elite are deepening.

In the past few days, Larijani - who was fired by Ahmadinejad as chief negotiator on nuclear issues with the west - has announced his intention of setting up a parliamentary committee to examine the recent post-election violence in an "even-handed way". In response, Ahmadinejad supporters within the parliament have discussed the possibility of impeaching Larijani.

In a move with even greater potential significance, according to several reports Rafsanjani has been lobbying fellow members of the powerful 86-strong Assembly of Experts, which he chairs, to replace Khamenei as the supreme leader with a small committee of senior ayatollahs, of which Khamenei would be a member. If Rafsanjani were successful, the constitutional change would mean a profound shift in the balance of power within Iran's theocratic regime.

"Although Hashemi Rafsanjani is not a popular politician in Iran any more, he is the only hope that Iranians have ... for the annulment of the election," said an Iranian political analyst who asked not be named. "He is the only one who people think is able to stand against the supreme leader."

The membership of the Assembly of Experts, which has the power to appoint the supreme leader, is split between those supporting Rafsanjani and those who have gravitated around the highly influential ultra-hardline cleric Mohammad-Taqi Mesbah Yazdi, who is widely seen as both a supporter of Ahmadinejad and the president's religious mentor. Yazdi is also believed to have his own ambitions to succeed Khamenei as supreme leader. Like Ahmadinejad, he is fiercely opposed to the push by reformists for more democratic representation in Iran.

Yazdi is also understood to have a large following among both the Iranian Revolutionary Guards Corps and the basiij militia, both also sources of support for Ahmadinejad.

Rafsanjani has long been a proponent of weakening the power of the supreme leader. He is understood to be arguing in favour of replacing Khamenei with a leadership council of three or more senior clerics.

The splits in the Assembly of Experts - the least visible aspect of the present crisis - will be critically important to its eventual outcome. Even avowed conservatives are reported to have sided with Rafsanjani against Yazdi and his faction, suggesting that there are real limits to the power it has been exercising in the past few weeks.

The complexity of the present political manoeuvres has meant Iran's elites have been made to take sides, reflected in the decision by almost half the members of the parliamentary assembly to boycott the celebration dinner called by Ahmadinejad to mark his "re-election".

The largely behind the scenes moves have come as Iranians opposed to the regime have been forced to go underground with their protests, despite the threats of Khamenei and the brutal attacks of the Revolutionary Guards and basiij militia.

The challenge to the street protests entered a new phase last week when Ayatollah Ahmad Khatami called for the execution of protest leaders at Friday prayers in Tehran in a further move seen as intending to intimidate the opponents of Ahmadinejad.

Despite that, the nightly defiant cry of "Allah-o-Akbar" (God is great) has increased since Khatami's warning.

In a further sign of defiance, large numbers of people have switched from wearing green to black, to mourn those killed by the security forces during demonstrations.

"Before this, black was an ordinary colour; now it has a different meaning," said Soheil, a 22-year-old student. "It means that you are angry with the government and you want re-election."

Others keep their car headlights on, also in protest. "It's not important for me whether the riot police destroy my car or not; the important thing is to continue my protest despite the huge censorship on the internet and SMS networks and TV channels," said 45-year-old Mina, as she drove - lights ablaze - through Tehran yesterday. "This is the only way I can show my protest."