(CNN) The most deadly Islamist terrorist attack ever in France followed weeks of warnings from French officials that the threat had risen to unprecedented levels.

Late last year French Prime Minister Manuel Valls said his country had never faced a greater terrorist threat.

Officials tell CNN the threat of terrorist attack in the European Union is greater than at any time since 9/11 because of the emergence of jihadist safe havens in Syria and Iraq. But no country faces a greater terrorist threat than France, with support for ISIS running deep among disenfranchised immigrant communities in the rundown, crime-ridden banlieues that surround many French cities.

The numbers tell the story: 390 French extremists are now fighting with jihadist groups in Syria and Iraq, according to French officials, with 231 believed to be on their way. Fifty-one have been killed in suicide bombings and combat. And 234 have left the conflict zone, with 185 now back in France.

Since the summer of 2013, French police say they have thwarted five terror plots.

Nerves were rattled in the run up to Christmas after a knife attack in a police station in Tours and car-ramming attacks in Dijon and Nantes on three consecutive days.

The Tours attack was the only one of the three that was definitively linked to Islamist terrorism.

JUST WATCHED Why does Islam forbid images of Mohammed? Replay More Videos ... MUST WATCH Why does Islam forbid images of Mohammed? 03:22

A few days after posting an ISIS flag on his Facebook page, Bertrand Nzohabonayo, a French-Burundian extremist, entered a police station in the central French town of Tours on Dec. 20 and stabbed several officers before being shot dead.

ISIS threats to France

ISIS has explicitly called for lone-wolf terrorist attacks in France because of its participation in airstrikes in Iraq by the U.S.-led coalition.

"If you are not able to find an IED or a bullet, then single out the disbelieving American, Frenchman or any of their allies. Smash his head with a rock or slaughter him with a knife or run him over with your car or throw him down from a high place or choke him or poison him," ISIS spokesman Abu Muhammad al Adnani stated in an audiotape in September.

On Nov. 19, three French ISIS fighters appeared in a French language video put out by the group's propaganda arm, repeating the call for attacks in France. One of them stated:

"Terrorize them and do not allow them to sleep due to fear and horror. There are weapons and cars available and targets ready to be hit. Even poison is available, so poison the water and food of at least one of the enemies of Allah. Kill them and spit in their faces and run over them with your cars. Do whatever you are able to do in order to humiliate them, for they deserve only this."

A significant number of the nearly 400 French nationals now fighting in Syria and Iraq are believed to have joined ISIS. That includes Maxime Hauchard, a 22-year-old convert from Normandy who French authorities suspect participated in the grisly on-camera beheading of more than a dozen members of the Syrian armed forces in November orchestrated by the British "Jihadi John."

French officials have for some time been worried that those on their way back to France -- or already back in the country -- could launch attacks.

In February, police in Cannes broke up an alleged plot to bomb targets in France by Ibrahim Boudina, a French-Algerian extremist who had allegedly just returned from fighting with ISIS in Syria. Police say they found almost a kilogram of the high explosive TATP in his family's Cannes apartment building. Boudina has denied the allegations against him.

Mehdi Nemmouche, a French-Algerian ISIS fighter who allegedly helped guard Western hostages in Syria before returning to Europe, allegedly shot and killed four people at a Jewish museum in Brussels in May.

Nemmouche was arrested in France and extradited to face trial in Belgium. He has denied the charges. In both the Cannes and Brussels plots, investigators believe it is possible the men were acting on their own steam. No evidence has been publicly released suggesting ISIS leadership signed off on the plots.

It is not just ISIS causing concern to French security officials. European counterterrorism officials tell CNN a relatively high number of French extremists have joined ISIS rival Jabhat al Nusra, al Qaeda's affiliate in Syria.

JUST WATCHED Johnson: U.S. is 'supporting the French government' Replay More Videos ... MUST WATCH Johnson: U.S. is 'supporting the French government' 02:00

Of most concern: David Drugeon, a French convert from Brittany who has emerged as one of the most skilled bomb makers in the Khorasan group, an al Qaeda A-team based in Syria's Idlib province with ties to Jabhat al Nusra.

U.S. officials tell CNN they believe Drugeon has been working on nonmetallic explosive devices that the group hoped to smuggle on board Western passenger aircraft and has been talent-spotting European extremists in Syria who can be trained for attacks in Europe. Drugeon was injured in a U.S. drone strike that hit a vehicle he was traveling in November.

New laws, old grievances

In November, France adopted tough new anti-terror legislation making it easier to shut down jihadist websites and confiscate passports and identity cards of those suspected of wanting to travel overseas to fight jihad.

But critics say the French government has done too little to tackle one of the key contributing factors to radicalization: The deep sense of alienation toward mainstream society felt by a significant number of young Muslim immigrants in the banlieues.

In the years after 9/11, France was held up as a model by many for its "assimilationist" agenda and its zero tolerance of extremist radical preachers. Britain, by contrast, was criticized for a "multicultural" approach that for too long offered political refuge to extremists from around the world.

But by the late 2000s, Islamist extremism had also become a significant problem in France. Although French leaders paid lip service to assimilation, the concept was only theoretical for young unemployed Muslims living in impoverished banlieues whose socioeconomic grievances were more acute than their counterparts in the United Kingdom.

While France could crack down on radical preachers in the 1990s, it was powerless to prevent the growth of jihadist websites and social media in the second half of the 2000s.

Jihad in Syria has become a "cause celebre" for French extremists able to access this content online. While many British extremists traveled to al Qaeda's safe havens in Afghanistan and Pakistan in the years before and after 9/11 because of their language and kinship ties to the region, much of France's banlieue population hails from North Africa, making travel to jihadist battlegrounds in the Arab world easier and more attractive.