A suspected terrorist’s alleged plot to open fire on Paris churches this past Sunday was thwarted after the supposed gunman accidentally shot himself.

After apparently shooting himself by accident Sunday, the man called an ambulance. Police found him on the street waiting for help and according to French publication The Local, he told cops he was the victim of a robbery. Officers followed a trail of blood to the man’s car, “which contained loaded guns and notes about potential targets,” the Associated Press reports. Police arrested the man at the scene.

According to what a source told the AP, the man, whose name has not been released, is a 24-year-old computer science student from Algeria who has lived in France for “several years.” He is also a suspect, USA Today reports, in the killing of Aurelie Chatelain, 32, who was found shot to death in her car Sunday.

“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,” French Interior Minister Bernard Cazeneuve told the AP Wednesday.

Police found more weapons, “as well as Islamic extremist material,” during a search of the man’s apartment in southeastern Paris.

[File photo via AP]