A 23-year-old man suspected of killing seven people in France has been shot dead as he scrambled out of a ground floor apartment window during a gunbattle with police.
Mohamed Merah, a French man of Algerian origin, died from a gunshot wound to his head at the end of a 30-hour standoff with police at his apartment in Toulouse.
He had said al Qaeda inspired him to kill three soldiers, three Jewish children and a rabbi.
Prosecuters and police said he was firing frantically at police from a Colt 45 pistol as he climbed through his apartment window onto a verandah and toppled to the ground some 1.5 metres below.
Two police commandos were injured in the operation
Paris prosecutor Francois Molins said Merah had taken refuge in his bathroom, wearing a bullet-proof vest under his traditional black djellaba robe, as elite police blasted his flat through the night with flash grenades.
Mr Molins said the gunman had filmed his three shooting attacks with a camera hung from his body and had indicated that he had posted clips online.
The most disturbing image of the attacks showed him grabbing a young girl at a Jewish school on Monday by the hair and shooting her in the head before escaping on a scooter.
Elite RAID commandos had been in a standoff since the early hours of Wednesday with Merah, periodically firing shots or deploying small explosives until mid-morning on Thursday to try and tire out the gunman so he could be captured.
Surrounded by some 300 police, he had been silent and motionless for 12 hours when the commandos opted to go inside.
Initially, he had fired through his front door at police when they swooped on his flat on Wednesday morning, but later he negotiated with police, promising to give himself up and saying he did not want to die.
By late Wednesday evening, he changed tack again, telling negotiators he wanted to die "like a Mujahideen", weapon in hand, and would not go to prison, Molins said.
Merah told negotiators he was trained by al Qaeda in Pakistan and killed three soldiers last week and four people at a Jewish school on Monday to avenge the deaths of Palestinian children and because of French army involvement in Afghanistan.
Merah had staked out the first soldier he killed after replying to an advertisment about a scooter, investigators said on Wednesday, and had identified another soldier and two police officers he wanted to kill.
His use of his mother's computer to lure his first victim, a French soldier of North African heritage like himself, gave police a vital clue, but not in time to prevent the other killings, even though he had taken the scooter to a mechanic for a respray before the final attack on Monday.
The crisis came during France's presidential election, in which President Nicholas Sarkozy has been lagging behind Socialist challenger Francois Hollande in opinion polls.
Presidential candidates suspended their campaigning. Mr Sarkozy said an inquiry would be launched into whether French prisons were being used to propagate extremism and urged people not to seek revenge for acts he described as terrorism.
Immigration and Islam have been major campaign themes after Mr Sarkozy tried to win over supporters of far-right candidate Marine Le Pen, who accused the government of underestimating the threat from fundamentalism.
Leaders of the Jewish and Muslim communities have called for calm, pointing out the gunman was a lone extremist.