Since his release from prison late last year, the prominent Sudanese Islamist and former Speaker of Parliament Hassan Turabi has been busy preaching democracy as the best possible system for Muslim countries. Many might consider Turabi's ardent espousal of democracy highly suspect, given his repressive record during the decade when he was Sudan's de facto ruler (1989-1999).

But Turabi is hardly the only Islamist now advocating democracy out of disillusionment with recent experiences with Islamization (in Turabi's case, the ruling system he helped to create was later used to imprison him). Across the Muslim world, there is a veritable stampede of Islamists away from hard-line positions. For many Islamists, the enemy is no longer the "renegade" secularists or the "scheming" West, but alleged extremists and their narrow-minded interpretations of Islam that advocate violence and assert that Islam is incompatible with democracy. Moderate Islamists are today at the forefront of a number of democratising experiments in the Muslim world.

The most important experiments are unfolding in Turkey and Iran. The two neighbouring rivals mirror each other in that in both the struggle is to liberalize and rationalize a militantly ideological state (the ultra-secularized republic in Turkey's case, and the militant Islamic republic in Iran's). In each country, the system revolves around a "sacred" ideology, a charismatic founder who is revered as an object of devotion, and an institutional core—comprised of an army, legal-political establishment and security apparatus—that acts as the guardian of officially sanctioned values. The ruling elite relies on quasi-authoritarian measures to maintain control, such as enforcing dress codes for women and vetting political actors to ascertain their faithfulness to the state ideology.

In both countries, moderate Islamists are at the forefront of the struggle to democratize, and thus rescue, the republic. The ruling Justice and Development Party (AKP) in Turkey and the broad coalition of reformists around President Muhammad Khatami in Iran—in which moderate Islamists play a key role—pay lip service to the ruling ideology, but their central objective is to reform this ideology and make it more compatible with democracy. In Turkey, the reformists seek to limit the army's influence in politics and to stop the state from dictating the private conduct of individuals. In Iran, the reformists are struggling to limit the role of the entrenched conservative religious establishment and to extend freedom of expression and association.

The prominent role being played by moderate Islamists in Turkey and Iran suggests that movements based on some form of Islamic legitimacy may be vital to effect a transition to stable and consensual governance in Muslim countries. These democratizing experiments have huge implications for the Arab world, where internal models for such a transition are so far lacking. In Sudan, Islamists have a monopoly on power, but they have failed to play a moderating role (perhaps because of their monopoly). Elsewhere in the Arab world, political space for Islamists (and all other groups) is severely restricted, hindering their ability to press for reform.

The Turkish and Iranian experiences are promising, but they are also precarious. The Turkish establishment remains extremely wary of the AKP, and the judiciary and the army are poised to thwart the new government. Setbacks have come, ironically, from Europe. The Islamists have based their reform program on the contention that bringing Turkish democracy in line with European standards would remove undue limitations on political freedoms (such as restrictions on religiously-oriented parties) and personal freedoms (such as restrictions on Islamic dress). Yet the European Court of Human Rights's 2002 decision upholding Turkey's 1998 ban on the Islamist Refah party (a precursor to the AKP) and the French parliament's February 11 vote to ban Muslim headscarves in schools are undermining moderate Islamists' arguments about the compatibility of Islam and secular liberal democracy. As it happens, Europe, or at least France, now is moving towards the Turkish model, not the reverse.

The situation is even more serious in Iran, where the diverse coalition of moderate Islamists and outright secularists is far from united over its long-term goals. Most secularists want to radically overhaul the system, while most Islamists seek to reform it. The conservatives have gone on the offensive, resorting to crude tactics to derail the reformist project, including the imprisonment (or assassination) of leading reformists, the closure of reformist publications, and the disqualification of thousands of reformist candidates for parliament.

Unless the entrenched establishment in both countries decides that its time is up and voluntarily relinquishes its monopoly on power, the forces of change are less likely to be moderate reformists than radical revolutionaries. The collapse of the Iranian and Turkish reform projects would be disastrous for those countries, and offer nothing but bleak lessons for Arab politics.

Abdelwahab El-Affendi is senior research fellow at the Centre for the Study of Democracy, University of Westminster, London.