TOULOUSE, France – Inspired by radical Islam and trained in Afghanistan, the gunman methodically killed French schoolchildren, a rabbi and paratroopers and faced down hundreds of police for 32 hours. Then he leapt out a window as he rained down gunfire and was fatally shot in the head.

France will not be the same after Mohamed Merah, whose deeds and death Thursday could change how authorities track terrorists, determine whether French Muslims face new stigmas, and even influence who becomes the next French president.

The top priority for investigators now is determining whether Merah, who claimed allegiance to al-Qaida, was the kind of lone-wolf terrorist that intelligence agencies find particularly hard to trace, or part of a network of homegrown militants operating quietly in French housing projects, unbeknownst to police.

Either way, French authorities are facing difficult questions after acknowledging that Merah, a 23-year-old Frenchman of Algerian descent, had been under surveillance for years and that his travels to Afghanistan and Pakistan were known to French intelligence – yet he wasn’t stopped before he started his killing spree on March 11. Merah had been on a U.S. no-fly list since 2010.

Three Jewish schoolchildren, a rabbi and three paratroopers died in France’s worst Islamist terrorist violence since a wave of attacks in the 1990s by Algerian extremists.

Merah filmed all three attacks, Prosecutor Francois Molins said Thursday, and claimed to have posted them online.

“You killed my brother; I kill you,” he said in the video of the first attack, in which one French paratrooper died, Molins said. “Allah Akbar,” (God is Great), he declared during the second, when two more soldiers were killed.

The prosecutor said Merah told police he wanted to “bring France to its knees.”

“While the facts concerning the three killings have been clearly elucidated, and Mohamed Merah carries full responsibility, the investigations are not finished,” he said.

Authorities are trying to determine whether Merah’s 29-year-old brother, Abdelkader, was involved, and are searching for accomplices who might have encouraged Merah to kill or furnished the means to do so, Molins said.

Merah espoused a radical form of Islam and had been to Afghanistan and the Pakistani militant stronghold of Waziristan, where he claimed to have received training from al-Qaida.

Merah also had a long record of petty crimes in France for which he had served time in prison, and prosecutors said that he started to radicalize behind bars.

Merah told negotiators he killed to avenge the deaths of Palestinian children and to protest the French army’s involvement in Afghanistan as well as France’s law against the Islamic face veil.

Police detained his mother and brother and surrounded Merah’s building soon after 3 a.m. Wednesday. They tried to detain Merah but were rebuffed by a volley of gunfire from his second-floor apartment in a calm residential area of Toulouse.

For the next day and a half, the police, the neighborhood and the nation waited.

Barricaded inside with no water, electricity or gas, Merah at first promised to surrender, but kept postponing the move. Finally, he declared he would not go without a fight, the prosecutor said.

Police were determined to take him alive, and tried to wait him out.

Near midnight Wednesday, the detonations began, as police set off blasts to pressure him to emerge and blew the shutters off a window. Through the night they continued.

Merah stopped talking to negotiators, Interior Minister Claude Gueant said, and suspicions surfaced that the gunman could have committed suicide.

Then around 11:30 a.m., police commandoes moved in, entering through the door and windows, Gueant said. Merah was in the last room they checked: the bathroom.

He burst through the door firing a Colt .45, then jumped out a window “with a weapon in his hand, continuing to shoot,” Gueant said.

In the gunfight, he was shot in the head, Molins said. He said the police acted in self-defense after some 30 bullets had been fired.

An autopsy was conducted Thursday but the results weren’t immediately released.