Islamism was born in Egypt in 1928. And it was in Egypt, 85 years later, that the first successful uprising against an Islamist government occurred. The overthrow of the Muslim Brotherhood is a momentous event: but to foreign observers, the army’s intervention overshadowed everything else.

In their state of shock and denial, the Brothers would certainly like to think that their unseating was purely a coup by the old regime. After an eight-decade cultural war to impose their unorthodox interpretation of Islam, they believed they had the hearts and minds of Egyptians safely tucked away in their pockets. Nothing could persuade them that ‘the people’ (or so many of them) would freely reject them. They were not alone in this belief. Over the years, dozens of news reports and academic studies have assured us that the ‘politics of piety’ would be the trump card in any power contest – at least if it were free. And once the rebellion unfolded, journalists and scholars found solace in the conviction that what was happening was no different from the Algerian, Turkish and Pakistani cases, where anti-Islamist coups repressed the pious majority.

But there is no reason to indulge their fantasy. It is true that without the support of the military and security forces, the revolt would have been aborted. And it is true that President Morsi’s failure to appease either the remnants of the old regime or the secular opposition threw them together in a tactical alliance against him. However, none of this can take away from the fact that 22 million Egyptians signed ‘rebellion petitions’ in the last three months, and this week 17 million of them, according to official figures (33 million according to the opposition), have marched against the chief representatives of Islamism.

For a president who paraded his democratic credentials at every opportunity, the viciousness of the religious rhetoric he deployed against his opponents was unnerving: demonstrators were collectively excommunicated; supporters said that the Archangel Gabriel prayed at the mosque where they were camped out; images of the Prophet’s epic battles against infidels, hypocrites and Jews were conjured. Islamist clerics openly declared jihad against protesters in front of television cameras, and presented themselves as ‘projects for martyrdom’ – so much for the Brotherhood’s advocacy of freedom and citizenship. And this was only the latest charge in the barrage of abusive language that Morsi’s supporters, drunk with power, had unleashed over the months. It all backfired. Millions of self-proclaimed Muslims refused to be either threatened or patronised; they refused to endorse the Brotherhood’s conflation of Islamism and Islam.

Certainly, the Brothers’ dismal performance in power brought about their downfall, rather than some elaborate debate on the legitimacy of Islamism. There was nothing Islamic about the movement’s policies. On the contrary, the moral image they projected was quickly comprised by the shabby deals they tried (and failed) to strike with old regime institutions, and foreign powers they had previously condemned. Once in power, Morsi praised the Interior Ministry so highly that he even claimed this most patriotic of institutions had been an essential partner in the 2011 revolt; and his aides spared no effort in imploring America to save his presidency. Egyptians became rapidly disillusioned with Islamist incompetence, paranoia, double-dealing and, above all, profound arrogance towards people they regarded as less religious than them.

It turns out that Morsi’s tenure was a blessing in disguise. If he had lost the presidency, Islamism would have remained the path not taken. But today, millions of Muslims have voted with their feet against Islamist rule. Those who grieve over this affront to ballot box democracy forget that Egypt, like any new democracy, has every right to seek popular consensus on the basic tenets of its future political system. Revolutionary France went through five republics before settling into the present order, and America needed a civil war to adjust its democratic path. It is not uncommon in the history of revolutions for coups to pave the way or seal the fate of popular uprisings. Those who see nothing beyond a military coup are simply blind. I asked the old, bearded man standing next to me in Tahrir Square why he joined the protests. ‘They promised us that Islam is the solution,’ he replied. ‘But under Muslim Brotherhood rule we saw neither Islam nor a solution.’ The country that invented Islamism may well be on its way to undoing the spell.