The problem is how liberals react to such fears. During the late 20th-century transitions to democracy in Southern and Eastern Europe, extremism and religion weren’t major factors. Different groups were thus able to agree on the rules of the game. Also, it was not the first try at democracy in most European countries, and the European Union was there to help. But in Egypt and other parts of the Arab world, the threat of extremism terrifies liberals, and thanks to years of authoritarianism, there isn’t a culture of compromise, nor is there a strong democratic neighbor to guide them.

The 1848 fiasco strengthened the radical elements of the socialist movement at the expense of the moderates and created a poisonous and enduring rift between liberals and workers. After liberals abandoned democracy, moderate socialists looked like suckers and radicals advocating a nondemocratic strategy grew stronger. In 1850, Marx and Engels reminded the London Communist League that they had predicted that a party representing the German liberal bourgeoisie “would soon come to power and would immediately turn its newly won power against the workers. You have seen how this forecast came true.” They went on to warn, “To be able forcefully and threateningly to oppose this party, whose betrayal of the workers will begin with the very first hour of victory, the workers must be armed and organized.” This is not the lesson anybody wants Islamists to learn now.

The mistake that liberals made in 19th-century Europe was to see all socialists as fanatics. But while some socialists were extremists, others were opposed to violence and dedicated to democracy. Those socialists — who later became Europe’s social democrats rather than communists — wanted social and economic reforms, but not ones that were mortal threats to capitalism or democracy. Yet, for too long, European liberals were unwilling to recognize those differences; they opposed full democratization and worked actively to repress the entire movement. The results were disastrous.

Radical, violent and nondemocratic elements within the socialist movement began to ask why workers should participate in a system unwilling to accept the possibility of their victory. And when socialists became the largest political force across Europe, liberals accepted unsavory bargains with conservatives to keep the Left out of power. As a result, European societies became increasingly divided and conflict ridden.

Egypt’s liberals are repeating those mistakes today. Once again, they see their opponents as zealots determined to abolish everything liberals value. But just as not all socialists were proto-Stalinists, not all Islamists want to implement a theocratic regime. There are moderate Islamists today who are willing to play by the rules of the game, and they should be encouraged to do so.

Islamism is still the largest and best-organized popular political force in Egypt, and it is vital that the Egyptian Army and its liberal allies let Islamists know there is a place for them in the region’s democratic future. If all Islamists are demonized, the divisions within Egyptian society will grow, the moderate Islamists will become marginalized, and Egypt’s political future will be troubled.

A century after 1848, social democrats, liberals and even moderate conservatives finally came together to create robust democracies across Western Europe — an outcome that could and should have happened earlier and with less violence. Middle Eastern liberals must learn from Europe’s turbulent history instead of blindly repeating it.