Wow. It’s sounds like France got really, really lucky on this one:

And it wasn’t great police work that “foiled” this terrorist, but his own incompetence:

Also of note, the terrorist was known to French authorities and had been “flagged as a risk last year.” From the AP:

An Islamic extremist with an arsenal of loaded guns was only prevented from opening fire on Sunday morning churchgoers because he accidentally shot himself, French officials said.

The 24-year-old computer science student, who was also suspected in the death of a young woman whose body was found on Sunday just ahead of his arrest, had been flagged as a risk last year and earlier this year but there was no specific reason to open a judicial investigation, Interior Minister Bernard Cazeneuve said Wednesday.

A French security official, who was not authorized to publicly release details, said the suspect — an Algerian who had lived in France for several years — was arrested in Paris Sunday after he apparently shot himself by accident and called for an ambulance. He was waiting outside for first aid when police arrived at the scene. They discovered a blood trail leading to his car, which contained loaded guns and notes about potential targets.

“Documents were also found and they prove, without any ambiguity, that the individual was preparing an imminent attack, in all probability, against one or two churches,” Cazeneuve said.

The woman he’s suspected of killing was a 32-year-old mother who was in Paris for a “work training program.” From the New York Times:

The student was also involved in the murder of a 32-year-old woman in a suburb south of Paris, Mr. Cazeneuve said. The woman, identified as Aurélie Chatelain, was found dead in her parked car in the town of Villejuif on Sunday.

Mr. Cazeneuve said Ms. Chatelain, the mother of a 5-year-old girl, was from northern France and was in Paris for a professional training program. Mr. Cazeneuve did not indicate whether the authorities were aware of any links between the student and Ms. Chatelain.

***

Related:

‘Have you looked in the fridge?’: Paris Jewish deli survivors sue French media for revealing hiding place to terrorist

Suspect in shooting of French policewoman reportedly has taken hostages at kosher grocery store in Paris; Update: False alarm on earlier reports of deaths?

‘WTF?’ ‘Did the Jews have guns?’ WaPo says Paris hostages were murdered in ‘shoot-out’

French police storm kosher grocery store; Hostage-taker dead [photos]

‘Reminder, it’s 2015′: Reports of Jewish stores ordered closed in Paris