A police sniper shot and killed the gunman who carried out a spate of murders in southern France, prosecutors say, after a 32-hour siege in Toulouse.
Mohammed Merah, 23, who claimed to have al-Qaeda training, opened fire on police commandos after they stormed into his flat at 09:30 GMT.
Prosecutors said he was shot in the head as he tried to flee.
Merah carried out three separate attacks, killing four people at a Jewish school and three soldiers.
He had said he was acting to "avenge Palestinian children" and protest against French military interventions overseas.
Prosecutor Francois Molins confirmed in a news conference that a police marksman had killed Merah as he tried to jump out of the bathroom window.
"The examination of the body shows that he was shot in the head and that he was wearing a bullet-proof vest," Mr Molins said, "and had a gun covered by a pair of jeans."
"Material to make Molotov cocktails were found on his balcony."
Mr Molins said a Colt 45 handgun was found next to his body, and he estimated that Merah had fired 30 bullets as the commandos broke in.
The prosecutor also confirmed that Merah had filmed all three of the attacks that he carried out.
Earlier President Nicolas Sarkozy said in a televised address that everything had been done to try to bring Merah to justice, but it was decided that no more lives could be put at risk.
He also vowed a new crackdown on those who visited "hate or terrorism" web sites or travelled abroad to be indoctrinated in terrorism.
Interior Minister Claude Gueant said officers had thrown grenades and entered by the door and windows of the flat.
After surveying the scene and finding no sign of the suspect, they went towards the bathroom, moving slowly as they were wary of booby-traps.
When officers tried to find out if there was anyone in the bathroom, the suspect came out firing several weapons.
Mr Gueant said the suspect was "shooting very violently. The bursts of gunfire were frequent and hard".
He said one of the officers involved told him "he had never seen such a violent assault".
Two officers were reported wounded in the attack.
Before police went in, officials had warned that Merah was armed with a Kalashnikov high-velocity rifle, a mini-Uzi 9mm machine pistol, several handguns and possibly grenades.
The authorities set off several explosions overnight to intimidate Merah.
Street lights were switched off in the vicinity of the building on Wednesday evening and surrounding areas evacuated.
In his TV address, Mr Sarkozy announced an investigation into whether Merah had accomplices and into possible Islamist indoctrination practices in prisons.
"The French should not give free rein to anger," he said.
"Our Muslim compatriots have nothing to do with the crazy actions of a terrorist. We should not embark on any stigmatisation."
Merah, of Algerian descent, claimed to have received al-Qaeda training in Pakistan's Waziristan area, and also said he had been to Afghanistan.
Commentators have criticised the intelligence services for failing to track Merah closely enough.
But Mr Gueant defended their record, saying intelligence agencies track many extremists, but such isolated cases were very difficult to defend against.
"These so-called lone wolves are formidable opponents," he said.
The killings took place in and around Toulouse in three separate incidents earlier this month.
On 11 March, a soldier was shot and killed while waiting to see a man about selling his motorcycle.
Days later, two soldiers were shot and killed and a third was wounded while waiting at a cash machine.
Then earlier this week, three children and an adult were shot and killed outside a Jewish school.
Mr Molins said the authorities had recovered videos from Merah's apartment showing the attacks.
"These films are extremely explicit, as we were able to verify yesterday, in which evidently we see him during his encounter with a soldier who he shot twice, saying to him: 'You kill my brothers, I kill you'," said Mr Molins.
"Then we also see him killing the soldiers in Montauban in an extremely violent scene, fleeing on his scooter whilst shouting 'Allahu akbar' [God is great]."
Mr Molins said there was also footage of the school massacre, and added that all of Merah's conversations with negotiators during the siege had been recorded and would be used in the forthcoming inquiry.