The mass murder of journalists at the Charlie Hebdo satirical magazine in Paris, the most devastating terrorist attack on French soil since the end of the Algerian war of independence in 1961, has stunned the nation.
But it has not surprised France's intelligence chiefs, who knew all along that it was only a matter of time before such outrages occurred. For France is sitting on a social and political volcano which virtually guarantees trouble of this kind over years to come.
Up to a decade ago, France was still viewed as Europe's most resilient nation in the fight against global terrorism.
The French exercised tougher immigration controls than the British or the Germans who, in the name of human rights, seemed ready to grant asylum to a variety of men of violence from around the world.
The British capital was derided as "Londonistan" due to its alleged tolerance of various extremist Islamist groups.
Add to this a centralised government system where French citizens are often required to show their identity cards so they can be easily tracked, and a robust judiciary meting out swift punishment against "enemies of the republic", and it is obvious why the domestic intelligence agency was considered second to none.
But the French gradually lost that lead, mainly because combating terrorism is not just a matter of effective law enforcement.
While terrorism in France was historically unrelated to Muslims or immigrants - it was largely perpetrated by white settlers in Africa who wanted to keep the French empire going, or by separatists in the Mediterranean island of Corsica - the waves of political violence over the past few decades are associated with immigrants of Muslim faith, and France is home to their largest number.
About 10 per cent of France's total population, or about 6.4 million people, are estimated to be of Muslim faith or origin, double the figures for Britain or Germany.
The share of those known to have volunteered for terrorism in France is tiny, not more than 0.05 per cent of all Muslim residents. But the sheer number of Muslims in France makes it the epicentre of potential terrorist networks.
Over the past five years, about 550 to 600 people were arrested in Europe for terrorist offences yearly. But the share of French citizens in the group rose from about 10 per cent of the yearly total at the start of the decade to about a third of all those arrested in 2013.
More importantly, the government estimates as many as 1,000 Frenchmen have left to fight for the so-called Islamic State in Iraq and Syria.
All in all, about 5,000 terrorist suspects require some surveillance, not an easy task for the General Directorate for Internal Security, the recently reformed French intelligence agency which has around 3,500 staff.
There are specific reasons for this worrying spike in France. One may be that global attention has shifted from violence in Afghanistan and Pakistan to wars in the Middle East and North Africa, where France's Muslims originate from, so current conflicts resonate more with them.
France's prominent role in military interventions in Libya, Mali and the Middle East may also encourage disenchanted French Muslims to join terrorist organisations.
But the biggest problem is the deep sense of alienation and social marginalisation suffered by large parts of France's Muslim community. They are confined to miserable, decaying housing estates on the edges of French towns, areas that become hotbeds of criminality.
Cherif and Said Kouachi, the brothers alleged to have committed the Charlie Hebdo murders, are perfect examples of this: no education and no prospects - the only paid job one brother had was selling fish in a market.
Of course, nothing justifies violence, but it is easy to see how marginalised, poorly educated people are sucked into this world of criminality.
Prime Minister Manuel Valls has reaffirmed his objective of "mobilising society and families" to "mend the social fabric of some neighbourhoods" in order to combat the "causes and consequences of Islamic extremism".
But in a country which, in the name of political correctness, still refuses to collect statistics on the race and religion of its people, such a process of social healing may take decades. And meanwhile, the security services are left to deal with the consequences rather than causes of the troubles.