Anyone can try to assassinate a politician, storm a parliament or blow up the Louvre. But it takes a special kind of terrorist to gun down the people who publish a satirical magazine.

"We have killed Charlie Hebdo," they shouted. "We have avenged the Prophet Mohammed." According to one witness, they spoke flawless French.

The terrorists who struck in the heart of Paris on Wednesday were not mentally imbalanced or socially marginalized. They were highly organized assassins who believe the West should live under a caliphate governed by strict Islamist law, and that blasphemers should die.

Story continues below advertisement

This attack – the deadliest terrorist attack on French soil in 50 years – may well pitch the country into profound crisis, because it crystallizes what everybody knows. France has a serious Muslim problem, a serious immigration problem and a serious terrorism problem, and the political class has no idea what to do about it. France is an easy target for Islamist terrorists because a large number of French Muslims are sympathetic to their causes.

Ironically, Charlie Hebdo's latest issue featured a cover story on Michel Houellebecq, a well-known provocateur whose new novel, Submission, predicts that France will vote for Muslim rule in less than a decade. The book has been denounced as a gift to anti-immigrant leaders like Marine Le Pen, the fastest-rising star in French politics. Earlier this week, before the killings, French President François Hollande cautioned that while literary freedom must be respected, the French must not give into "fear" of "submersion, invasion, submission."

But the critics have it exactly wrong. France's problem is not that it has too much literary freedom. The problem is the attack on freedom by a murderous ideology.

Among the elites both inside and beyond France, it is fashionable to dismiss anti-immigrant and anti-Muslim sentiment as parochial and backward – a symptom of "the bitterness of those who feel alienated in a world they find bewildering and hateful," as Ian Buruma put it in The Globe and Mail last weekend.

The non-elites see things differently. France's Muslim population has reached an estimated 6.5 million – roughly 10 per cent of the population – and many of them have assimilated poorly. Despite the billions of euros poured into immigrant-dominated "sensitive urban zones" since the riots of 2005, nothing has improved. Youth unemployment in these areas is upward of 40 per cent, according to The Economist. Sixty per cent of France's prison inmates are of "Muslim religion or culture," and the prisons have become breeding grounds for radicalization.

The allure of the Islamic State has drawn hundreds of French nationals to Syria. And support for them is surprisingly widespread. "This is the ideology of young French Muslims from immigrant backgrounds," said Newsweek's France correspondent, Anne-Elizabeth Moutet.

The Western fight against the Islamic State isn't the only provocation. French Muslims from sub-Saharan Africa have found their own jihad in the conflict in Mali, where Muslim insurgents are battling a French-backed international force. Marc Trévidic, a top anti-terrorism judge, says the French have to get used to the idea that terrorism is here to stay. "We will have to accept this reality without deluding ourselves," he told Le Journal du Dimanche. "It means we have to accept that attacks will succeed and there will be deaths."

Story continues below advertisement

And whatever Mr. Buruma may say, anti-immigrant and anti-Muslim sentiment has spread far beyond French society's left-behinds. An Ipsos survey published in 2013 found that 74 per cent of French citizens view Islam as "intolerant" and "incompatible" with French values. Seventy per cent of respondents said there are too many foreigners in France, and 67 per cent said they no longer feel at home in their own country. As writer and filmmaker Emmanuel Carrère put it, France is undergoing a "huge mutation."

The elites were shocked when Ms. Le Pen's National Front scored big gains in last year's European elections. In retrospect, nothing could have been more predictable – except, perhaps, a fresh horror like Wednesday's.

France's agonizing problems are in plain sight. And there's no easy fix.