The Nile Palace Bridge, where some of the fighting in Egypt's revolution took place, is today a popular shrine. The bedlam of street life in Cairo, a city of 12 million people where traffic lights are an afterthought, is amplified on this bridge.

Kids taunt each other by hanging off the bridge over the fast-flowing Nile. They could not have produced a better image for the revolution itself. A year and a half on, it is perilously poised.

At a stroke, the gameplan of SCAF – the ruling military council – became clear for all to see. If parliament were dissolved, the constituent assembly drawing up the constitution would be abolished with it. If on Monday the army's candidate, Ahmed Shafiq, is declared the winner, the old regime would have conducted a clean sweep of the revolution: the power to order new parliamentary elections, the power to rewrite the consitution and the presidency. A counter-revolution in all but name.

For some observers like the columnist Fahmi al-Huweidi, signs of the counter-coup were apparent before the constitutional court's decision. "Journalists who were paid by the old regime and who had disappeared from the media for over a year suddenly began resurfacing with a barrage of articles saying why they were supporting Shafiq. Who gave them the courage to speak out like this? It would be have been impossible a few months ago."

Another sign was a bizarre declaration on Wednesday by the justice minister empowering all members of the security and armed forces and police to arrest any civilian causing trouble in the streets – a power not seen since emergency rule, which Egypt has only just abandoned. It was as if they were anticipating trouble.

But the move may be backfiring. The Muslim Brotherhood did not take the bait by withdrawing its candidate, Mohamed Morsi, from the race, thus handing the presidency to Shafiq – although there were fierce arguments within the movement at their headquarters in Moquatom in Cairo to do just that.

Instead, the quiet technocrat Morsi came out fighting in the early hours of the morning. He said the Egyptian people would not allow a counter-revolution, and if the weekend's vote was rigged in favour of Shafiq, the brotherhood would call everyone out on to the streets and the revolution would be "stronger" than it was before.

Further, Morsi said he would retry Mubarak and his aides and prosecute anyone found to be involved in rigging: "Those who try to abort the will of the people will face trial. I will give my life to protect the freedom and dignity of the people." Strong stuff, and this from the man who only hours before, when he first heard of the court's judgment, told the television channel Dream 2 that the dismissal of parliament did not amount to a military coup. "I love the military forces," he said.

What happens now will depend on a number of factors. All polls, taken from outside and by the brotherhood itself, indicate a Morsi win by a majority of 75% to Shafiq's 25%. But only if the elections are fair. The expat vote which has already been declared from Egyptians living in Saudi Arabia, Kuwait, the Emirates are consistent with these figures — although, interestingly, almost every Egyptian citizen living in Israel voted for Shafiq.

The political map of Egypt is not uniform. Cairo would naturally vote for the person they call the stability candidate, Shafiq – but the governate of Giza, centre of the tourism industry, by the pyramids just outside Cairo, will be solidly for the brotherhood.

Then there are the byzantine ways of what is called "soft rigging". In the first round, 2m false ID cards were issued to members of the armed forces and security services who are by law forbidden to vote. The ballot boxes in roughly half of the polling stations were left unguarded by representatives of all political parties for 11 hours. About 40% of the 90m electorate fall below the international poverty line, and in rural areas voters were given 500 Egyptian pounds to vote for any candidate other than the brotherhood.

This is certainly not the last throw of the dice for the old regime, but the challenge is whether the rigging will be enough to tilt the balance in Shafiq's favour. If it is, the military have been clearly warned by the brotherhood that they will return to the streets. Leftist and youth movement leaders who have been bitterly critical of the brothershood's decision to contest the presidential election have also apparently now pledged their support for Morsi's candidacy. The coup by the constitutional court may have had a galvanising effect on a split opposition movement, whose line until now was "a plague on both houses".

Not all army generals are in favour of Shafiq, and some see the writing on the wall. Whatever happens, Egypt has been changed by the revolution. It is no longer forbidden to challenge authority. The Pharonic mask has slipped from the face of Egypt's new rulers.

But to get to a political order which reflects this new reality may yet be hard and possibly bloody work. Like the Nile running below the children on the bridge, the revolution is still running a turbulent course.