One good thing about the outcome of Sunday's (July 22) Turkish election is that now the army can't make a coup.
It may still want to: it was certainly making menacing noises about it recently. But after almost half the voters (47 per cent) backed the incumbent AK (Justice and Development) Party, the army simply cannot move against it. A great many officers would just refuse to act against the popular will in such a blatant way, and the army would never risk a split in the officer corps.
The even better thing about the election is that the Turks have decisively rejected the false dichotomy between "political Islam' and "democracy' that paralyses politics in so many other Muslim countries.
That matters, because Turkey is a rapidly developing middle-income country of 75 million that still has hopes of joining the European Union. (The current obstructionism of leaders in France, Germany, Austria and a few others is irrelevant, since they will probably all be gone by the time a decision is taken in 10 or 12 years' time.)
The election outcome is also important for other Muslim-majority countries.
Most foreign reporting of the Turkish election followed the script provided by the main opposition parties, the Republican People's Party (CHP) and the Nationalist Action Party (MHP), in which they were defending enlightened, secular democracy in Turkey and the AK Party was just a front for ignorant hordes of rural Muslim fanatics who wanted to shove sharia law down the nation's throat.
It was a "test of Turkish secularism,' they claimed - and if it was, then secularism lost. But that isn't what really happened at all.
The real struggle in Turkey was between the "republican elite" and practically everybody else. The republican elite are a privileged and well-educated class of people who have virtually monopolized senior jobs in the military, the judiciary and the state bureaucracy for several generations, claiming that they must have control in order to defend Kemal Atatürk's secular reforms (from the 1920s!).
But these days that's just a pretext for preserving their power. Secular democracy in Turkey is not in danger.
There are certainly Turkish fanatics who would like to force all their fellow citizens to conform to their particular brand of religion on pain of death. Every country has some of those, but they are as rare in Turkey as they are in Spain - and while the ones in Turkey probably do vote for the AKP, since it is the only party that openly espouses "Islamic values,' they are a tiny proportion of its supporters.
Indeed, it's likely that quite a few of the people who voted for the AK Party this time aren't even believers. Although officially 99 per cent Muslim, Turkey has lots of unofficial non-believers, especially in the big cities, and many of them would have been attracted by the party's impressive economic record (five unbroken years of high-speed growth), its unwavering commitment to membership in the European Union and above all its determined attempts to liberalize Turkey's legal system.
The AK Party has consistently used the need to make Turkish law conform to EU norms as a justification for changing the law in ways that expand individual rights. Of course, that also undermines the ability of the republican elite to control the state from behind the scenes, so they are fighting back by accusing the AK Party of being a Trojan horse for fanatics who want to stop Turks from drinking alcohol and force women into "Islamic' clothing.
The AK Party denies it and has spent the last five years in power moving consistently in the opposite direction, and most Turkish voters believe it.
The larger significance of the AK Party's success is that it demonstrates that devout Muslims can co-exist with their less devout fellow citizens in a democratic constitutional order.
In Muslim-majority countries where the secular holders of power and the Islamist revolutionaries see one another as mortal enemies - which is to say, in about half the countries of the Muslim world - peaceful democratic change, compromise and coexistence of the sort we can see in Turkey are regarded as impossible.
There is very little space between them for people who would quite like more democracy and civil rights but don't fancy living under sharia law as interpreted by extremists.
Opening up that space is the most important political task these countries face. The interesting thing about Turkey is that it has been the Islamic activists, not the secularists, who did the hard work that made it happen.
But let's be honest: even the AK Party would have found it hard to open up the Turkish system if it had not had the prospect of membership in the European Union as an inducement for everybody to be reasonable and cooperative. It's unlikely that the EU will be offering Egypt or Pakistan membership any time soon.
Gwynne Dyer is a London-based independent journalist whose articles are published in 45 countries. His latest book is The Mess They Made: The Middle East After Iraq.firstname.lastname@example.org