Now that Iran's Supreme Leader, Ali Khamenei, has placed himself shoulder to shoulder with his officially elected president, Mahmoud Ahmadinejad, the very existence of the Islamic regime may now be questioned openly in a nation ever more divided between reformists and those who insist on maintaining the integrity of the 1979 revolution. Had Khamenei chosen a middle ground, some small compromises towards the countless millions – for in the election, it appears, they were indeed uncounted – who oppose Ahmadinejad, then he might have remained a neutral father-figure. Mir Hossein Mousavi and his supporters had religiously – in the most literal sense of the word – refused to criticise the Supreme Leader or the existence of the Islamic Republic during last week's street demonstrations

But reacting as all revolutionaries do even decades after they have come to power – for the spectre of counter-revolution remains with them until death – Khamenei chose to paint Ahmadinejad's political opponents as potential mercenaries, spies and agents of foreign powers. Treason in the Islamic Republic is, of course, punishable by death. But Khamenei's political alliance with his very odd and hallucinatory president may have sprung from fear as much as anger.

During his Friday prayers address at Tehran University, the Supreme Leader mentioned the dangers of a "velvet" revolution and it is clear that the regime has been deeply concerned by the democratic overthrow of Eastern European and west Asian governments since the fall of the Soviet Union. People power – through which the 1979 revolution was ultimately successful – is a devastating weapon (albeit the only one) in the armoury of a serious but unarmed political opposition.

Download the new Independent Premium app Sharing the full story, not just the headlines

In the aftermath of the Ahmadinejad "success" at the polls, his supporters were handing out leaflets condemning the secular revolutions of Eastern Europe, and their content says much about the anxieties of Iran's clerical leadership. One of them was entitled: "The system of trying to topple an Islamic Republic in a 'velvet revolution'." It then described how it believes Poland, Czechoslovakia, Ukraine and other nations won their freedom.

"'Velvet' or 'colourful' revolutions... are methods of exchanging power for social unrest. Colourful and 'velvet' revolutions occurred in post-communist societies of central and Eastern Europe and central Asia. Colourful revolutions have always been initiated during an election and its methods are as follows:

"1. Complete despair in the attitude of people when they are certain to lose an election...

"2. Choosing one particular colour which is selected solely for the Western media to identify (for their readers or viewers)." Mousavi used green as his campaign colour and his supporters still wear this colour on wristbands, scarves and bandannas.

"3) Announcing that there has been advance cheating before an election and repeating it non-stop afterwards... allowing exaggeration by the Western media, especially in the US.

"4) Writing letters to officials in the government, claiming vote-rigging in the election. It's interesting to note that in all such 'colourful' projects – for example, in Georgia, Ukraine and Kyrgyzstan – the Western-backed movements have warned of fraud before elections by writing to the incumbent governments. In Islamic Iran, these letters had already been written to the Supreme Leader."

Another leaflet maintained that a study – which Khamenei's advisers have obviously undertaken, however inaccurately – demonstrated that vote-rigging will be alleged on the very day of the election and that victory will be claimed by the opposition hours before the counting is finished and before their own defeat is announced. The results, says the document, will therefore already have a "background" of fraud. "In the final stages... supporters gather in front of the regime's official offices, holding colourful banners and protesting against vote-rigging." This part of the demonstration, the leaflet says, "is run by the foreign media who are the opposition movement's supporters so that they make good pictures and mislead the international community".

All this shows a unique and obsessive concern among the Supreme Leader's disciples about just how popular Mousavi's post-election campaign has become. Even the cutting of SMS and mobile communications – and in a sophisticated society such as Iran, this must have cost millions of dollars – did not prevent the calling of rallies which always assembled at the same moment and at the same place.

What we are now seeing is a regime which is far more worried than the Supreme Leader suggested when he threatened the opposition so baldly on Friday. Having refused any serious political dialogue with Mousavi and his opposition comrades – a few district recounts will produce no real change in the result – the Iranian regime, led by a Supreme Leader who is frightened and a president who speaks like a child, is now involved in the battle for control of the streets of Iran. It is a conflict which will need the kind of miracle in which Khamenei and Ahmadinejad both believe to avoid violence.