Sometime in the 1980s, when the communist regime in Poland was facing serious challenges from disaffected masses, the regime’s official spokesman, Jerzy Urban, remarked to a foreign journalist that there were only two choices in Poland: communism or domination by the Catholic Church. “It’s either us”, he said, “or the Black Madonna of Czestochowa”.

Similar warnings have been repeated over and over by oppressive rulers in the Middle East, not least by Egypt’s Hosni Mubarak: either the secular police state or the Islamists; either Mubarak or the Muslim Brotherhood. This message was persuasive enough for Western governments, especially the United States, to continue to lavish money and arms on Mubarak and other Arab “allies”.

For those who advocate the spread of democracy in the world, this has posed an awkward dilemma. Islam, many say, is a threat to democracy. The West is said to be “at war with Islam”, to quote the Somali-born activist Ayaan Hirsi Ali. But does that mean that should we give up on democracy if Islamist parties have a chance of winning elections?

This was French policy after the Islamic Salvation Front (FIS) won the first round of elections in Algeria in December 1991. France supported a military coup the following year. It was also the policy of the US after Hamas won the Palestinian elections in 2006. Hamas was not recognised. The US has supported police states in Egypt, Saudi Arabia, and Central Asia - because the alternative was thought to be worse.

From this hard choice arises another dilemma. Violent crackdowns rarely result in moderation. The greater the repression that religious parties face in secular police states, the more extreme their politics are likely to become. Whatever drives the extremism of Osama bin Laden, he would not have found so many willing recruits for his acts of mass murder if the regimes in Egypt, Saudi Arabia, or Algeria had been less oppressive and corrupt.

Religious politics - or politics based on religious faith - are not invariably violent, even in the Islamic world. Nor are Muslims the only ones to rebel against secular regimes in the name of their faith. Urban’s dictum contained a kernel of truth: the Catholic Church played a major role in the rebellion against communism. The same is true of Buddhists in Burma, who oppose the military junta. Religious organisations can mobilise people in opposition to corrupt, oppressive rulers. Most rebellions, after all, are moral as well as political.

True, once religious institutions take over political power, they are never democratic. They cannot be, because religious authority demands obedience to divine power, which by definition is not open to rational challenge. When Ayatollah Ruhollah Khomeini and his followers hijacked the Iranian revolution in 1979, democracy became impossible; the cleric had become a dictator.

But this does not mean that political parties whose programs are based on religious faith cannot be democratic. Christian Democrats pose no danger to democracies in Europe. Turkey’s Justice and Development Party, founded by Islamist reformers, is not undemocratic either - the question is whether it is liberal.

Indeed, one of the most interesting features of the uprisings in Tunisia and Egypt – and possibly also the most consequential – is the very minor role played by Islamists. In Tunisia, the banned Islamist party Ennahdha ['Renaissance'] was absent. In Egypt, the Muslim Brotherhood, also banned but still a major force in terms of public support, has stayed very much in the background.

There is no figure in either country comparable to Khomeini. There has been no violent jihadist rhetoric. What appears to have driven so many people into the streets is a common sense of economic frustration, disgust with official corruption - and humiliation at being oppressed.

These feelings can inspire religious faith - or horrific violence perpetrated in the name of faith. Such an outcome remains possible, especially if the rebellions fail and more oppression follows. But, even in the best case, if free elections were to be held - perhaps after interim governments led by such fatherly figures as Mohammed ElBaradei, Islamist parties could still play a major role. The Muslim Brotherhood in Egypt, despite being banned, is a formidable organisation.

There are good reasons to be worried about this, less because the Islamists are undemocratic than because of their illiberal tendencies. Some forms of authoritarian government can leave a certain amount of room for economic and other freedoms - and thus might be easier to live with than illiberal democratic populism. But liberal authoritarianism seems an unlikely outcome of the current revolts. As a result, the consequences of a failure to hold elections, a violent crackdown - or a takeover by another authoritarian regime would surely be worse than taking a chance on democracy.

Egypt is not Iran or Algeria, so one should be careful about drawing parallels. But we have seen what can happen when democratic aspirations are thwarted out of fear of religious radicalism.

The Algerian military coup in 1992 crushed the Islamists, many of whom, admittedly, were neither liberal, nor necessarily committed to democracy. But the vicious civil war that followed – and has still not entirely concluded – caused the violent deaths of up to 200,000 people.

So far, the crowds in Cairo, Alexandria, and Suez have been neither violent, nor inflamed by religious fervour. Serious fighting only broke out after supporters of Mubarak began to attack the crowds. What will happen is still impossible to predict.

Perhaps the Muslim Brotherhood would win a general election. But perhaps not. Egyptians should be allowed to make that choice. Denying them that freedom would almost certainly make things worse, possibly leading to precisely the kind of religious extremism that many people rightly fear.

Ian Buruma is Professor of Democracy and Human Rights at Bard College. His latest book is Taming the Gods: Religion and Democracy on Three Continents.