(CNN) -- French gunman Mohammed Merah, the self-styled al Qaeda jihadist accused of killing seven people, died in a hail of bullets Thursday as police moved in to end a day-long siege.
He was shot in the head as he jumped out of a window with a gun in his hand, authorities say, ending a deadly episode that has shaken the nation.
As a picture emerged of a man who was known to the police and had apparently sought out Islamist jihadists in Pakistan and Afghanistan, many have questioned why it took so long to track him down.
The 23-year-old first struck March 11, killing a soldier in Toulouse. Another shooting in Montauban four days later left two soldiers dead, and a third attack on a Jewish school in Toulouse Monday killed four people, three of them children.
Announcing Merah's death, Interior Minister Claude Gueant said a special forces expert had told him they had never seen a suspect resist with such ferocity.
Merah had shown what a dangerous man he was by first telling police he would negotiate and then declaring he would resist arrest with lethal force, Gueant said.
And when police finally entered his apartment, he burst out of a bathroom with guns blazing and continued shooting to the end, Gueant said.
French President Nicolas Sarkozy said that every effort had been made to take Merah alive, but in the end, no more lives could be put at risk to achieve that.
Merah still had guns, ammunition and the ingredients to make petrol bombs in his apartment when it was raided, Paris prosecutor Francois Molins said, and was wearing a bulletproof vest.
CNN terrorism analyst Paul Cruickshank said that from an al Qaeda perspective, Merah went down in a blaze of glory, still firing at special forces as he died.
He had told police commandos late Wednesday that he wanted "to die as a mujahedeen," Molins said.
But Molins, who is France's counterterrorism chief, rejected the suggestion that intelligence forces had failed by not picking up the serious threat posed by Merah sooner.
Merah, a French national of Algerian origin, had not followed a traditional route to radicalization or joined known Islamist networks, Molins said, actions which would have triggered closer scrutiny.
Nonetheless, Merah had been under surveillance by French intelligence for a couple of years, having "already committed certain infractions, some with violence," Gueant told CNN affiliate BFM-TV.
Merah spent considerable time in Afghanistan and Pakistan, the minister added.
His attendance at an al Qaeda training camp there led to him being placed on the U.S. no-fly list, a U.S. intelligence official, who was not authorized to speak to the media, told CNN.
On Wednesday, the interior minister told how Merah, under siege, had boasted of his actions to police through the closed door of his apartment in the southwestern city of Toulouse.
"He claims to be a jihadist and says he belongs to al Qaeda," Gueant said. "He wanted to avenge the Palestinian children and take revenge on the French army because of its foreign interventions."
Molins said then that the suspect told the officers surrounding his apartment that he had acted alone -- and that he had intended to carry out more attacks on police and a soldier Wednesday.
Merah's only regret was that he was not able to kill more people, the prosecutor said, and he boasted of having brought France "to its knees."
Molins said Merah had initially indicated that he was not intending a suicide mission and wanted to live. But as the siege wore on, the chances of the suspect emerging alive receded.
Now all attention is likely to be focused on what caused him to strike -- and whether Merah did, as he said, act alone.
Investigators looking at a possible role played by his older brother, Abdelkader Merah, want more time to question him, Molins said, and are following up other leads. His mother is also being questioned.
Police tracked Merah down via his mother's computer IP address, which was apparently used to respond to an ad posted by the first shooting victim, officials said. Gueant initially told reporters it was the IP address of Merah's brother that led investigators to him.
But little is known about what triggered Merah's radicalization.
In one clue, Molins said Merah had told police he started reading the Quran while in prison, after presumably being exposed to more radical ideologies there.
Lawyer Christian Etelin, who represented Merah in connection with previous minor offenses, said his client went to Afghanistan two years ago.
He had become suddenly radicalized, Etelin told BFM-TV, and wanted to become more involved politically.
Etelin last saw Merah, whom he described as having a "complex" personality, on February 24, when he appeared in court accused of driving without a license and causing an accident with injuries.
Merah was sentenced to a month in prison and was to appear before the judge again in early April to determine where he would serve that sentence, the attorney said.
But a series of clues, some relating to a scooter used in the attacks, instead led investigators late Tuesday night to the apartment in Toulouse where Merah holed up under siege, armed and dangerous.
The shootings had already revealed a ruthless and determined killer.
All seven victims were shot in the head, most at point-blank range, and authorities said they were carefully targeted because of their religious and ethnic ties.
The gunman's first victims were three soldiers of North African origin who had recently returned from Afghanistan, who were shot dead in two incidents. Days later, the killer struck again, killing a rabbi and three children at the Jewish school Monday.
More details of how Merah planned and executed the attacks are likely to emerge in the coming days.
Videos he took of the attacks, seen by police, suggests a cold-blooded brutality. "Allahu Akbar," (God is great) he says as he guns down the two soldiers in Montauban.
Merah said he had posted the video online, but police do not yet know where, Molins said.
Merah claimed to have trained with al Qaeda in Pakistan's Waziristan region, bordering Afghanistan, Molins said.
He was sent back from Afghanistan to France after being picked up at a traffic stop by Afghan police who reported his presence to international forces, the prosecutor said.
The French defense ministry said Merah had twice tried to join the country's armed forces. The first time, in the northern city of Lille, he was turned down because of his prior convictions. The second time, in July 2010, he attempted to sign up for the Foreign Legion in Toulouse, but left during the first round of testing, the ministry said.
Although his neighbors describe him as having been a quiet man, at home Merah had watched violent jihadist videos online, including footage of decapitations, Molins said.
He was sentenced 15 times by a Toulouse juvenile court when he was a minor, the prosecutor added.
Police have questioned other family members in Toulouse, including his mother, Zoulika Aziri, Molins said.
Mohammed Merah was born in Toulouse in October 1988, according to Elisabeth Allanic, magistrate at the prosecutor's office in Paris, and at one time he worked in a garage in a Toulouse suburb.
He grew up in a northern suburb of city called Les Izards, which lawyer Etelin described as an area with some drug-related activity.
Etelin told BFM-TV he had represented Merah since 2004 or 2005, when his client was a minor, mostly over accusations of theft.
He said Merah had been "polite and courteous" and had shown no signs then of a tendency toward radicalization.
That might have changed after his trips to Pakistan and Afghanistan, but Etelin said he didn't notice a big difference.
"I knew he was politically active but he never spoke to me about this. He didn't want to talk about this," Etelin said.
"He was very discreet on this. But I never had the impression that he was an individual radically different from the one I knew in the beginning. I always knew him as being someone very flexible in his behavior, courteous, polite, soft and certainly not rigid to the point of being led by a certain fanaticism."
Etelin said that before the alleged murders, he had mainly been in contact with Merah's older sister, who, along with their mother, had been "exasperated" with Merah's minor crimes. "It was not possible to see him being serious," the sister had said, according to Etelin.
CNN's Diana Magnay, Dheephi Namasivayam, Saskya Vandoorne, Pierre Meilhan, Carol Cratty and Anna Pritchard contributed to this report.