THE sight of corrupt old Arab tyrants being toppled at the behest of a new generation of young idealists, inspired by democracy, united by Facebook and excited by the notion of opening up to a wider world, has thrilled observers everywhere. Those revolutions are still in full swing, albeit at different points in the cycle. In Tunisia and Egypt they are going the right way, with a hopeful new mood prevailing and free elections in the offing. In Libya, Syria and Yemen dictators are clinging on to power, with varying degrees of success. And in the Gulf monarchs are struggling to fend off demands for democracy with oil-funded largesse topped by modest and grudging political concessions.

So far these revolts have appeared to be largely secular in character. Westerners have been quietly relieved by that. Not that they are all against religion. Many—Americans in particular—are devout. But by and large, they prefer their own variety to anybody else's, and since September 11th 2001, they have been especially nervous about Islam.

Now, however, there are signs that Islam is a growing force in the Arab revolutions (see article). That makes secular-minded and liberal people, both Arabs and Westerners, queasy. They fear that the Arab awakening might be hijacked by the sort of Islamists who reject a pluralist version of democracy, oppress women and fly the flag of jihad against Christians and Jews. They worry that the murderous militancy that has killed 30,000 over the past four years in Pakistan (see article) may emerge in the Arab world too.

Islam on the rise

In Libya the transitional national council, slowly gaining recognition as a government-in-waiting, is a medley of secular liberals and Islamists. There are Libyan jihadist veterans of Iraq and Afghanistan among the rebels, though not in big numbers. An American general detects “flickers of al-Qaeda” among the colonel's foes being helped by the West, raising uncomfortable memories of America's alliance against the Russians with Afghanistan's mujahideen, before they turned into al-Qaeda and the Taliban.

The Muslim Brotherhood, which has branches all over the region, is the best-run opposition movement in Libya and Egypt; and last week's constitutional referendum in Egypt went the way the Brothers wanted it to. Its members have long suffered at the hands both of Western-backed regimes, such as Hosni Mubarak's in Egypt, and of anti-Western secular ones, such as Bashar Assad's, now under extreme pressure in Syria. In Tunisia, too, the Islamists, previously banned, look well-placed. On the whole, these Brothers have gone out of their way to reassure the West that they nowadays disavow violence in pursuit of their aims, believe in multiparty democracy, endorse women's rights and would refrain from imposing sharia law wholesale, were they to form a government in any of the countries where they are re-emerging as legal parties.

All the same, the Brothers make many people nervous. At one extreme of the wide ideological spectrum that they cover they are not so far from the jihadists, many of whom started off in the Brothers' ranks. The leading Palestinian Islamist movement, Hamas, an offshoot of the Brotherhood, has been delighted by Mr Mubarak's fall. It has in the past carried out suicide-bombings in the heart of Israel and refuses to recognise the Jewish state. Some liberals say that more extreme Islamist groups are riding on the more moderate Brothers' coat-tails. In the flush of prisoner releases, hundreds if not thousands of Egyptian jihadists are once again at large.

Don't despair

Use the interactive "Graphics Carousel" to browse our coverage of unrest in the Middle East

Islam is bound to play a larger role in government in the Arab world than elsewhere. Most Muslims do not believe in the separation of religion and state, as America and France do, and have not lost their enthusiasm for religion, as many “Christian Democrats” in Europe have. Muslim democracies such as Turkey, Malaysia and Indonesia all have big Islamic parties.

But Islamic does not mean Islamist. Al-Qaeda in the past few years has lost ground in Arab hearts and minds. The jihadists are a small minority, widely hated by their milder co-religionists, not least for giving Islam a bad name across the world. Ideological battles between moderates and extremists within Islam are just as fierce as the animosity pitting Muslim, Christian and Jewish fundamentalists against each other. Younger Arabs, largely responsible for the upheavals, are better connected and attuned to the rest of the modern world than their conservative predecessors were.

Moreover, some Muslim countries are on the road to democracy, or already there. Some are doing well. Among Arab countries, Lebanon, with its profusion of religions and sects, has long had a democracy of a kind, albeit hobbled by sectarian quotas and an armed militia, Hizbullah. Iraq has at least elected a genuine multiparty parliament.

Outside the Arab world, in Turkey, Malaysia and Indonesia, Islam and democracy are cohabiting fairly comfortably. Many devout Muslims among the Arab protesters, including members of the Brotherhood, cite Turkey as a model. Its mildly Islamist government is showing worrying signs of authoritarianism these days, but it serves its people far better than the generals did. Iran, which once held so much sway, is not talked of as a model: theocracy does not appeal to the youngsters on the Arab street.

Still, Muslim countries may well make choices with which the West is not comfortable. But those inclined to worry should remember that no alternative would serve their interests, let alone the Arabs', in the long run. The old autocrats deprived their people of freedom and opportunity; and the stability they promised, it is now clear, could not endure. Algeria's civil war in the 1990s remains a horrible warning against depriving Islamists of power they have rightfully won.

Islam will never find an accommodation with the modern democratic world until Muslims can take responsibility for their own lives. Millions more have a chance of doing just that. It is a reason more for celebration than for worry.