* Gunman dead after jumping from window
* Police blast apartment with explosions all night
* Two police commandos wounded in shootout (Adds detail)
By John Irish and Nicholas Vinocur
TOULOUSE, France, March 22 (Reuters) - A 23-year-old gunman who said al Qaeda inspired him to kill seven people in France died in a hail of bullets on Thursday as he scrambled out of a ground-floor window during a gunbattle with elite police commandos.
Mohamed Merah, a Frenchman of Algerian origin, died from gunshot wounds at the end of a 30-hour standoff with police at his apartment in southern France and after confessing to killing three soldiers, three Jewish children and a rabbi.
He was firing at police as he jumped out of the window, Interior Minister Claude Gueant told reporters near the five-storey building, in a suburb of the southern city of Toulouse.
Two police commandos were injured in the operation - a dramatic climax to a siege which riveted the world after the killings shook France a month before a presidential election.
"At the moment when a video probe was sent into the bathroom, the killer came out of the bathroom, firing with extreme violence," Gueant said. "In the end, Mohamed Merah jumped from the window with his gun in his hand, continuing to fire. He was found dead on the ground."
Elite RAID commandos had been locked in a tense 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, Merah 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 ground-floor flat on Wednesday morning, but later he negotiated with police, promising to give himself up and saying he did not want to die.
He 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.
President Nicolas Sarkozy, who is running for re-election next month called Merah's killings terrorist attacks and announced a crackdown on people following extremist websites.
"From now on, any person who habitually consults websites that advocate terrorism or that call for hate and violence will be punished," he said in a statement. "France will not tolerate ideological indoctrination on its soil."
His handling of the crisis could well impact an election race where for months he has lagged behind Socialist challenger Francois Hollande in opinion polls.
Early on Thursday, the first opinion poll since the school shooting showed Sarkozy two points ahead of Hollande in the first-round vote on April 22, although Hollande still led by eight points for a May 6 runoff.
Three years of economic gloom, and a personal style many see as brash and impulsive, have made Sarkozy highly unpopular in France, but his proven strong hand in a crisis gives him an edge over a rival who has no ministerial experience.
Sarkozy vowed on Wednesday that justice would be done and urged people not to seek revenge.
Merah had been under intelligence surveillance and the MEMRI Middle East think tank said he appeared to belong to a French al Qaeda branch called Fursan Al-Izza, ideologically aligned with a movement to Islamise Western states by implementing sharia law.
He boasted to police negotiators that he had brought France to its knees, and that his only regret was not having been able to carry out more killings.
French commandos had detonated three explosions just before midnight on Wednesday, flattening the main door of the building and blowing a hole in the wall, after it became clear Merah did not mean to keep a promise to turn himself in.
They continued to fire shots roughly every hour, and stepped up the pace from dawn with flash grenades.
"These were moves to intimidate the gunman who seems to have changed his mind and does not want to surrender," said interior ministry spokesman Pierre-Henry Brandet.
He was tracked down after a no-holds-barred manhunt in France, during which presidential candidates suspended their campaigning.
Immigration and Islam have been major campaign themes after Sarkozy tried to win over supporters of 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.
On Thursday, far-right candidate Marine Le Pen accused Sarkozy's government of surrendering swathes of often impoverished suburban districts to Islamic fanatics, demanding that the last month of pre-election debate put the focus back on failing security. (Additional reporting by Jean Decotte in Toulouse and Daniel Flynn in Paris; Writing by Catherine Bremer; editing by Philippa Fletcher)