Even the most global events, those whose reverberations are felt far beyond their borders, are rooted in the specific and the local. This week's coup d'etat in Egypt, the army stepping in to remove and then arrest the democratically elected president, is no different. The toppling of Mohamed Morsi had a hundred causes, many of them wholly peculiar to Egypt. A choice example: Morsi wanted to close all shops at 10pm, so that Egyptians would be fully rested in time for morning prayers. That didn't go down well in famously nocturnal Cairo where, as the New Yorker put it, "there are still traffic jams at 2am and where internet usage peaks at 12.45am".

Still, what happens in Egypt matters outside Egypt. The country is just too important to keep its upheavals to itself. Consider that one in four Arabs are said to be Egyptian, the ancient nation repeatedly setting the lead the rest of the Arab world follows. One example: within a decade or two of Nasser taking power in the early 50s, similar regimes were in place in Iraq, Libya, Syria and Sudan.

One analyst says that the implications of these latest events will resonate even further, reaching Indonesia, Pakistan and every place where Muslims form the majority. Of course the nearer neighbours are affected most directly. The ambitious Gulf state of Qatar, Morsi's fellow Islamists in Turkey and the Muslim brothers of Hamas are among the initial losers, each having invested heavily in the one-year president only to see that investment evaporate. But the fallout spreads far wider. For this represents a deep blow not just to Morsi and the other Brotherhood leaders rounded up on the generals' orders – some of them jailed in the very same prison that houses Hosni Mubarak and his sons. It strikes at a larger project, namely the creation of a modern and viable form of political Islam, one that aspires not merely to be a movement of protest, but capable of government. Granted a trial run on the biggest possible stage, that show has now closed after just a year.

What to make of this failure of the Islamist experiment? The hostile will give a smug shrug and say this was no surprise. Citing the conduct of the man who before Morsi was most regularly named as the potential model of moderate Islamism, Turkey's Recep Tayyip Erdoğan – who last month crushed a wave of anti-government protests – they will sigh and regret without sincerity that this proves Islam and democracy are simply incompatible. They might repeat that oft-quoted nugget of cynicism, that in the Muslim world democracy means "one man, one vote, one time". In this view, the Egyptian election of 2012 was always bound to be a freak event, never to be repeated.

Defenders of Islamism will say the problem lay not within, but without – that the Morsi brand of political Islam was denied the chance to prove itself, strangled at birth by the forces that took back control this week. In this version, the Brotherhood was cheated of power it had won fair and square.

Less straightforward is the view of those who dream of a secular, liberal democracy flowering in Egypt. Many are cheered by this week's events: the theocrats have been scattered, their power-grabbing constitution suspended. Liberals might concede that, yes, this victory came about in strange fashion, delivered by the very armed forces they were demonstrating against 18 months ago. But there are coping mechanisms available to deal with such contradictions, denial chief among them. Note the message in English on the front of the al-Tahrir newspaper – "It's a revolution … not a coup, Mr Obama!" – or the delicate term chosen by the Egyptian novelist Ahdaf Soueif, who insisted this was not a coup, but a "deposal".

Yet this is to underestimate the danger of what has happened. To remove an elected president, to arrest a movement's leaders and silence its radio and TV stations, is to send a loud message to them and to Islamists everywhere. It says: you have no place in the political system. It says: there is no point trying to forge a version of political Islam compatible with democracy, because democracy will not be available to you.

It is the same message sent in Algeria two decades ago, when Islamists were on course to win an election but were pushed aside in a military coup before they could take power; and similarly in Gaza in 2006, when Hamas won the votes but were internationally shunned. Except this week, the point has been rammed home in one of the largest, historically mightiest Muslim nations. Chatham House's Nadim Shehadi worries that, after this week, "extremists will tell moderates, 'Don't even bother fighting elections. This is what happens to us if we win.'".

In Egypt the peril is very clear, made vivid by Friday's fear, partly realised, that the pro-Morsi forces' "day of rejection" would turn violent. The Muslim Brotherhood could, once again, be driven underground. It renounced violence long ago and few believe it will go back. But more radical jihadist voices – recall that at al-Qaida's helm is Ayman al-Zawahiri, an Egyptian – will now have a powerful rhetorical weapon. You tried the democratic route, they will say. And look where it got you.

The specific challenge for Egypt now is to somehow stop this pendulum swing from secular, military-backed dictatorship to illiberal democracy and back again, in which one set of masters seeks to replace entirely the other – typified by Morsi's winner-takes-all approach to power. A more durable accommodation would surely recognise that Islamist and secular Egypt have to live together and share power. That will require the Muslim Brotherhood not to draw the conclusion that they cannot rule democratically, but that they cannot rule alone.

The west are not detached bystanders in all this. US influence in the region may be diminishing, but in Egypt it retains power of the rawest kind: its $1.3bn in military aid gives it all but a veto over the Egyptian armed forces – aid, incidentally, that under US law will be cut off if Obama dares use the word "coup". The US could have used that muscle to head off this crisis months ago, pressuring the army and Morsi to come to an agreement. (Instead, secretary of state John Kerry seems more excited chasing the dream of an Israeli-Palestinian peace, even though the signs there are hardly encouraging.) That way, says Shehadi, Morsi would have been allowed to serve out his term, eventually be ridiculed as corrupt and incompetent, lose the next election – "and we'd have forgotten political Islamism for a generation". Instead, he and his movement will be martyrs.

Of course, it's hard not to root for the crowds in Tahrir Square, thrilled to be rid of a man apparently bent on becoming a theocratic tyrant. But the manner of his departure could pave the way for something far worse – for Egypt and beyond.

Twitter: @freedland