LONDON - France's security services have feared for months that their country could be targeted by another terrorist atrocity designed to kill many civilians, similar to the deadly machinegun spree that left 17 people dead in Paris in January.
But few expected the attacks to be as devastating as those which hit the French capital. "What happened in Paris is the scenario which our intelligence services dreaded most," admits Mr Bernard Squarcini, the man who until a few years ago was responsible for France's internal security.
And worse still may be in the offing for, as French President Francois Hollande rightly told his people over the weekend, their country is now at "war". This will be a long battle, with plenty of casualties but no decisive victory, a fight in which steady nerves, perseverance and good organisation will be key.
It is unfair to blame the French security services for failing to detect planning for the terrorist attacks on Paris, which must have been in the making for weeks if not months beforehand, and almost certainly involved more than just the suicide bombers who perpetrated the crimes.
For the French have been rather good at foiling similar plots in the past. In August this year, they arrested one suspect for allegedly planning to hit concert halls, an eerie early warning of what followed in Paris over the weekend. And last month, another plot to hit French naval installations in the port of Toulon was dismantled in good time by efficient intelligence work.
Yet, as is the fate of all intelligence communities, the successes of the French security services are easily forgotten, while failures are recalled forever.
That is not to say that improvements in France's intelligence work are not required: although it now gets more money, the DGSI, the country's domestic security service, was initially starved of funds, beset with various bureaucratic problems and hampered by inadequate laws which did not give it the powers it needed.
And it also faces a daunting task: According to a recent admission by French Interior Minister Bernard Cazeneuve, the intelligence services are expected to track up to 2,000 citizens currently involved in various domestic militant cells, plus an additional 3,800 who are "showing signs of radicalisation".
France's predicament is also that of Britain, Germany, Italy and Spain, big European countries with large migrant communities where the men of violence can easily find recruits. Keeping tabs on all such suspects is virtually impossible, and intelligence slip-ups remain inevitable; all that the security services can do is to reduce them by obtaining adequate resources, and by keeping up with evolving technologies.
Although these are early days in the investigation of the latest Paris atrocities, one source of particular concern for France's spies is that they apparently failed to pick up any electronic "chatter" before the attacks took place; such electronic communications often precede a coordinated terrorist plot.
The explanation for this "silence" may be that the gang which operated in Paris was particularly good at evading detection, or that the terrorists are benefiting from increasing online and mobile phone encryption technologies, which the intelligence services are unable to crack fast enough.
So, further investment in technology, backed with the necessary additional legal powers to intercept such communications, remains an absolute must.
But simply maintaining the current mix of other European policies is not an option either. One problem facing Europe is the relative ease by which terrorists seem to acquire automatic weapons and plenty of ammunition.
Much of this lethal firepower does not come from the Middle East, but from various parts of the Balkans, where former communist arsenals are plentiful, and respect for law and order scant.
Still, the trade is facilitated by the absence of European border controls and the rise of "trading hubs" in illicit weapon dealing. One such hub is Brussels, the Belgian capital, from where the terrorists who perpetrated the January atrocities in Paris seemed to have obtained their weapons; a Belgian-registered car also appears to have been used in the latest Paris attacks as well.
The Belgian authorities are fighting hard to stamp out this trade; the latest terrorist attacks in Paris were swiftly followed up with subsequent arrests of alleged collaborators in Belgium. Nevertheless, European governments will need to rethink the way their current anti-terrorism co-operation works, for the continent has open borders, but not an open flow of information.
Furthermore, although all politicians should be careful not to make unsubstantiated connections between the current flow of refugees from the Middle East and the attacks in Paris, it does not defy human imagination to assume that, if borders are open to literally millions of newcomers who produce no travel documents, it is relatively easy for terrorist organisations to plant some of their agents among these asylum-seekers.
The bloodshed in Paris is a reminder that Europe's current system of open borders simply does not work, and must be reformed. It would be a tragedy if the continent reinstates permanent border controls. But the temporary reimposition of such checks is now a necessity, at least until new arrangements to provide for better defences on Europe's outer borders with Africa and the Middle East are in place.
And all European governments need to take another hard look at their counter-radicalisation programmes, which were originally intended to help young or vulnerable members of the continent's Muslim communities to resist the propaganda and brainwashing which incites them to violence. None of these programmes has worked as intended, and few ever will.
Resources are better spent on more urgent measures to reduce the economic marginalisation of many European Muslim communities, a process which in itself breeds criminality and violence.
And nowhere is this more evident than in France, home to Europe's biggest Muslim community, but also the country where a shocking 70 per cent of the country's prison population are Muslim, despite the fact that Muslims comprise less than 10 per cent of the French population.
The overwhelming majority of France's prison inmates are not behind bars for terrorist activities, but for other crimes, such as theft, drug dealing or robbery. Still, the prisons are now the breeding ground for radicalisation.
Mohamed Merah, the gunman on a scooter who filmed himself giggling while machine-gunning seven people including young children in the French city of Toulouse in 2012, began adult life as a small-time delinquent, was sent to prison, and emerged a militant.
Mehdi Nemouche, author of the May 2014 murder of four people in Brussels, was also radicalised in a French prison. And Cherif Kouachi and Amedy Coulibaly, two of the terrorists responsible for the January murders in Paris, were persuaded of their "vocation" to kill people while serving prison terms.
France's bizarre system of leaving Muslim communities in rotting housing estates on the edges of towns, of failing to train or employ most of these communities' youth and then failing to prevent their radicalisation once they get caught in the judicial system is a disaster, a breeding ground for violence.
So is France's obtuse refusal to even collect statistical data on its ethnic and racial minorities; the refusal is born out of lofty ideals of equality, but ends up as merely obscuring the search for solutions.
Ultimately, however, no European country has found a miraculous answer to the problem of integration. And even if European governments were to now apply policies which promote the peaceful integration of their Muslim communities while isolating those who advocate violence, it may take decades before the scourge of terrorism abates on the continent.
So, meanwhile, there is no alternative but to continue fighting terrorism with all the powers governments can muster. For, as Mr Alexis Brezet, the editor of Le Figaro, one of France's top newspapers, aptly put it over the weekend, "Against brutality there is only one principle: force. And against savagery, there is only one law: efficiency."
This article was first published on November 16, 2015.
Get a copy of The Straits Times or go to straitstimes.com for more stories.