—French anti-terrorism police blasted into a Toulouse apartment Thursday and, in a fierce gun battle, killed the young Islamic radical who admitted killing three off-duty soldiers, three Jewish schoolchildren and a rabbi in an eight-day terrorism spree.

The sharp, five-minute clash brought an end not only to the 31-hour siege of Mohammed Merah’s apartment in a working-class neighborhood, but also to the national shudder that ran through France as it learned of Merah’s crimes and his cold-blooded determination to carry out still more killings had he not been run to ground.

Interior Minister Claude Gueant said Merah, a 24-year-old French national of Algerian origin, had broken off contact with police negotiators shortly before midnight, vowing to shoot any police officers who came near. Earlier, during marathon conversations with police, Merah had freely acknowledged killing the soldiers, rabbi and children in three separate attacks.

Two gunshots were heard inside Merah’s apartment in the early hours of Thursday morning, Gueant said, generating speculation that the young extremist might have committed suicide.

But when heavily armed paramilitary police entered the apartment through the door and several windows about 10:30 a.m., Gueant said, Merah burst out of the bathroom, firing away.

Armed with a Colt .45 pistol, he shot so fast “it sounded like an automatic weapon,” said Francois Molins, the chief Paris prosecutor.

After sweeping the apartment with gunfire, Gueant said, Merah jumped out of an open window “and he was found dead on the ground below.”

Molins, speaking later, said Merah was killed by a bullet that slammed into his head, fired by police as they returned Merah’s gunshots in what Molins described as legitimate self-defense.

His killing brought relief that the tragic episode was over. But the relief was overshadowed by the knowledge that Merah now cannot be brought to a public trial, as ordered by President Nicolas Sarkozy.

Molins said Wednesday that Merah told negotiators that he carried out the killings in the southwestern cities of Toulouse and Montauban to avenge the deaths of Palestinian children killed by Israelis; challenge France’s military role in Afghanistan; and protest last year’s law banning Muslim women from wearing full-face veils on the street.

Sarkozy was described as furious that such hateful crimes could be committed in France. In addition, the issues Merah cited as motivation are particularly sensitive as Sarkozy runs for reelection in two rounds of voting, scheduled for April 23 and May 6. The president is eager to be seen as a firm defender of security, lest any of his conservative support shift to the far-right candidate, Marine Le Pen of the National Front.

“This man wanted to bring the republic to its knees,” Sarkozy said at a memorial service for the soldiers. “The republic did not bend. He will pay for his crimes.”

The only threat to France now, Sarkozy told Jewish and Muslim community leaders on Wednesday, would be the desire for revenge by one community against another.

“Terrorism will not succeed in fracturing our national unity,” he said.

Molins told reporters that Merah said he had made plans to kill a fourth soldier Wednesday and two Toulouse policemen at a later date.

“He had no regrets, except that he did not have the time to carry out more killings,” Molins said.

In a 2 a.m. Wednesday telephone call to the newsroom of France 24, the government’s all-news television station, Molins said, Merah declared that he was a follower of al-Qaeda and laid out the political reasons for his acts. He carried out all three attacks alone, he added in the phone conversation with an overnight editor, and they were filmed by a video camera that witnesses said was around his neck.

Merah, who was at one time a body-shop employee, was arrested 15 times as a juvenile on charges such as purse-snatching and possessing stolen goods, Molins said. Several acquaintances interviewed by French reporters said that Merah was not a particularly devout Muslim while growing up and that during one phase he dressed in punk clothes.

Christian Etelin, a lawyer who defended Merah two months ago on a charge of driving without a valid license, said the well-spoken young man gave no indication of a radical bent. “He was discreet, polite and courteous,” Etelin recalled. “I always knew an individual who was flexible in his behavior, well policed.”

Molins said Merah went to Afghanistan for the first time about eight years ago to receive military training and was captured by Afghan government police. After being turned over to the U.S. military, Molins said, he was put on a plane back to France. He traveled to Afghanistan a second time several years ago but fell ill and had to return.

Because of the trips, the Interior Ministry’s Central Directorate for Domestic Intelligence had been tracking Merah for several years, Molins said. This was a key element that led police to his Toulouse apartment, the prosecutor added.

The first French soldier who was killed, on March 11 in Toulouse, was shot in the head at close range by someone who had answered his Internet ad to sell a motorcycle. Police computer specialists found that one response to the ad had come from a computer belonging to Merah’s mother, whose name was also in the directorate’s computers.

Another tip came from a dealer of the kind of Yamaha motor scooter that was used in all three attacks. One of the Merah brothers visited the dealership last week to ask for advice on how to remove a tracking device commonly installed on the scooters to trace them if they are stolen.

As soon as the dealer reported the visit, police homed in on the tracking device, which led them to the scooter parked near Merah’s apartment building.

Molins said it remains unclear to what degree Merah was acting as part of a group. Merah’s devoutly Islamic brother, Abdelkader, was taken into custody for questioning, he said, along with his mother and Abdelkader’s girlfriend, but any involvement by them in the shootings is being investigated.

The hunt for Merah came to a climax as the three schoolchildren and the Hebrew teacher who were killed outside a Toulouse school on Monday were buried in Jerusalem on Wednesday. All four were dual Israeli-French nationals. In a display of France’s concern, Foreign Minister Alain Juppe accompanied the four bodies from France to Israel and attended the services.

A short time later, Sarkozy presided over the ceremony in Montauban honoring the three soldiers. The first, Imad Ibn Ziaten, 30, was killed as he bargained over his motorcycle in Toulouse. The two others, Abel Chennouf, 25, and Mohamed Legouade, 23, were shot at close range four days later in Montauban, 10 miles to the north, as they took money from an automated teller machine. Another was badly wounded, Sarkozy said, and is in a coma.