REVOLUTION sweeps away a hated tyrant, unleashing a joyous jumble of hopes. Amid the cacophony a faint but steady drumbeat grows louder. Soon the whole country marches to this rhythm. Those who fall out of step find themselves shunted aside or trampled underfoot, sacrificed to the triumph of an idea that many exalt as noble but no one can define.

It happened in Iran when Ayatollah Ruhollah Khomeini steered a broad uprising against the shah into a grimly Islamist cul-de-sac. Might the same fate await Egypt, where elections seem set to produce a solid majority of Islamists in parliament? And might the example of Egypt, the most populous and culturally radiant of Arab countries, spread across a region primed for revolutionary change?

The bold early advance of Egypt's Islamists, in an electoral process that still has several rounds to run, has come as a shock to many, including the country's own largely secular elite. It had been widely assumed that the Muslim Brotherhood would capture a plurality rather than an outright majority of votes, much as its cousins, Nahda in Tunisia and the Justice and Development Party in Morocco, have recently done. Founded in 1928 and hounded by all governments despite—especially recently—professing a fairly moderate version of Islam, the Brotherhood is known for its political savvy as well as its resilience and discipline. The dozens of other parties competing in Egypt's elections are inexperienced, narrowly based or tainted by association with the fallen regime.

In the first round of voting for the lower house of parliament, covering a third of Egypt's 27 governorates, the Brotherhood's Freedom and Justice Party won a startling 46% of seats with 37% of the party-list vote. More striking still was the performance of Nour, the Party of Light, a rival representing the puritanical Salafist strain of Islam. Partly inspired by Saudi Arabia's strict Wahhabism, Egypt's Salafists seek to purge the faith of modern accretions and impose literal interpretations of dogma.

Though only a few months old, and despite doubts that it could unite an array of often squabbling Salafist factions, Nour won 24% of the party-list vote and 21% of the seats. The biggest secular party trailed with 10% of the seats. In some districts the neophyte Salafists beat the Brotherhood's slick political machine by wide margins. Add in smaller parties that are offshoots of the Brotherhood, and the Islamists appear to have secured two-thirds of the first-round seats. Much of the voting to come is in rural districts that are Islamist strongholds, so this tally is unlikely to diminish before the next two rounds of elections conclude in mid-January.

Why did the scale of the Islamists' triumph so surprise Egypt's mainly secular pundits? Mostly this reflects the success of Egyptian governments, beginning long before Hosni Mubarak came to power, in denying that the bulk of Egyptian society has always been deeply conservative and fervidly religious. Whatever inroads secularism made in the 20th century, a generation-long, worldwide Islamist revival has washed much of it away.

Explore our <a href= interactive Arab league map" src="https://www.economist.com/sites/default/files/20110219_WOP586_290.jpg" srcset="https://www.economist.com/sites/default/files/20110219_WOP586_290.jpg 1x" width="290" height="163" alt="" data-slim="1" data-teg-id="ccttm3jrer1p2lkj7alfjt2qkto5ve89">

The reality is that most Egyptians remain grindingly poor, ill educated and alienated from a ruling class seen as more attuned to Western fashions than local custom. In a survey of attitudes in seven Muslim-majority countries in December 2010 by Pew, an American research organisation, Egyptians proved the most likely to prefer “fundamentalists” over “modernisers” as champions of Islam. More than half of Egyptians favoured separating the sexes at work, compared with just 13% among Turks. Only Pakistan matched Egypt's enthusiasm for such traditionally Islamic penalties as stoning for adultery, amputation for theft and death for apostasy, despite the fact that Egyptian courts have shunned such punishments for a century.

Youssef Ziedan, an Alexandrian novelist, explained in a recent column that he came to understand the Salafists' attraction after taking a wrong turn and getting lost in a maze-like ghetto whose existence he had been completely unaware of. This was just one of hundreds of such places across the country, with untold thousands jammed into dark streets under no guidance or rule: “People there have no recourse except to Islamists; there is no one else to impose any sort of order. The Mubarak regime created such realities by neglecting Egyptians whose only sin was that God created them in the age of Mubarak.”

Villagers in the rural province of Fayoum, south-west of Cairo, who were for decades corralled to vote for Mr Mubarak's party in fraudulent polls, got little in return except for brutal police, venal officials and rutted roads. But for many years Muslim Brothers have paid small stipends to widows and supplied water buffaloes on easy repayment plans to landless peasants. Salafists, whose fiery sermons thrill mosque-goers and have propelled a fashion for full-face veils, now also do their bit, distributing cut-price food for religious feasts and offering classes in Koran recitation. Perhaps more importantly, they have gained a bully pulpit on numerous Saudi-funded satellite television channels that beam round-the-clock religious fare.

The recent elections brought out colourful banners and blaring tannoys in Fayoum's remotest hamlets but almost none advertised secular parties. Rallies graced by telegenic Salafist preachers attracted tens of thousands, while a curious few listened politely to youthful leftists talking up revolution. Small wonder that the province gave 14 of its 16 seats to Islamists. Four went to the Salafists, whose numbers were, ironically, boosted by voters once beholden to Mr Mubarak's now-disbanded party, who are still instinctively mistrustful of the Brotherhood.

What do they want to do?

Surrounded by well-wishers at his home on a narrow dirt street in the village of Nazla, Wagih al-Shimi insists his Nour party would have done even better if the Brothers had not cheated. Blind from birth and lushly bearded, Fayoum's new MP is a doctor of Islamic jurisprudence, preaches in local mosques, and has a reputation for resolving disputes according to Islamic law.

“We owe our success to the people's trust, to their love for us because we work for the common good, not personal gain,” says Mr Shimi. As for a party programme, he says his lot will improve schools, provide jobs and reform local government, introducing elections at every level to replace Mubarak-era centrally appointed officials. As for the wider world Mr Shimi is vague, except to say that Egypt should keep peace with any neighbour that refrains from attacking it.

The Brotherhood echoes this parochialism: its party's 80-page manifesto mentions neither Israel nor Palestine. The two groups have more in common. The Brothers profess to share the Salafists' end goal; namely, to regain the pre-eminent role for Islam in every aspect of life that they believe it once held. Some leading Brothers even describe themselves as Salafist in ideology. Many secular Egyptians, too, especially Coptic Christians, who make up an increasingly beleaguered 10% minority, see little difference between rival Islamists.

Allah be praised Yet within the broad spectrum of political Islam, the distinctions between two are telling. Muslim Brothers tend to be upwardly mobile professionals, whereas the Salafists derive their strength from the poor. The Brothers speak of pragmatic plans and wear suits and ties. The Salafists prefer traditional robes and clothe their language in scripture. The Brothers see themselves as part of a wide, diverse Islamist trend. The Salafists fiercely shun Shia Muslims. Asked what he thinks of Turkey's mild Islamist rule, a Nour spokesman snaps that his party had nothing to take from Turkey bar its economic model. Nour says it rejects Iranian-style theocracy, but equally rejects “naked” Western-style democracy. Instead, in what some Salafists see as a daring departure from previous condemnation of anything that might dilute God-given laws, it wants a “restricted” democracy confined by Islamic bounds. Yasir Burhami, a top Salafist preacher, says that his mission is to “uphold the call to Islam, not to impose it on people.” Still, he believes the party can convince Egyptians to accept such things as banning alcohol, adopting the veil and segregating the sexes in public because “we want them to go to heaven”. Brotherhood leaders say instead that they must respect the people's choice. Their party includes a few Christians. It worked hard to build a coalition with secularists, too, though most of its partners soon withdrew. Whereas Nour party leaders openly call for an alliance with the Brothers to pursue a determined Islamist agenda, the older group, with its long experience of persecution, is wary. It says fixing Egypt's ailing economy should take priority over promoting Islamic mores. The Brotherhood would probably prefer a centrist alliance that would not frighten foreign powers or alienate Egypt's army, which remains an arbiter of last resort. In any case, a Brotherhood-led government is not in the immediate offing. Egypt's generals, discomfited as anyone by the Islamists' advance, seem determined to find ways to delay it. They insist on retaining the right to appoint a cabinet and are seeking to dilute the new parliament's role in writing a constitution. Egypt's fractious liberals are deeply sceptical of the military, but may revert to accepting a further dose of military dictatorship to stave off the Islamist tide, at least for a while. Just possibly, they may also embrace the Brothers as the best guarantee of getting the soldiers back to the barracks.

Whatever the outcome, Egypt looks set to join a broader regional trend that has seen a more pragmatic, tolerant form of Islamism rise to dominate the political scene, by way of the ballot box rather than the gun barrel. As Islamist parties come to the fore, from Iraq to Morocco, it is worth bearing in mind the words of Safwat Abdel-Ghani, the leader of an Egyptian Salafist group that once preached terrorism in the name of jihad, on the death of Osama bin Laden: “Al-Qaeda has not been destroyed by the ‘war on terror' but by popular revolutions that made it unnecessary.”