Under orders to seize him alive, French anti-terrorism forces engaged in marathon negotiations Wednesday with a young Islamist accused of killing three soldiers, three Jewish schoolchildren and a rabbi during an eight-day string of point-blank shootings in southwest France.

The standoff began in a blaze of gunfire as paramilitary forces approached the suspect’s apartment in a working-class neighborhood of Toulouse at 3 a.m. Wednesday. Two policemen were wounded in the initial burst, one in the shoulder and the other in the knee, and the suspect warned that he had several weapons and knew how to use them.

At that point, the situation turned into a waiting game, with the suspect behind his door and police negotiators trying to persuade him to surrender. The standoff continued late into Wednesday night, as riot police cut off electricity and natural gas into the building and set off small explosions outside, blowing off the apartment’s shutters to pressure the man to surrender, the Associated Press reported.

The authorities’ patience seemed to reflect a determination by President Nicolas Sarkozy to put the man on public trial for what were described as terrorist acts by a committed Islamist militant who had trained at a Taliban camp in Afghanistan.

Sarkozy was described as furious that such hateful crimes could be committed in France. In addition, the issues the suspect has cited 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.”

France’s Jewish and Islamic authorities, along with relatives of the victims, expressed relief that a suspect had been cornered. The only threat to France now, Sarkozy told them, would be the desire for revenge by one community against another.

“Terrorism will not succeed in fracturing our national unity,” he said he told the community leaders.

Francois Molins, the chief Paris prosecutor heading the investigation, said the suspect, whom he identified as Mohammed Merah, 24, told negotiators that he had carried out the killings to avenge 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.

Merah, a French national of Algerian origin, said in long conversations through a barricaded door that he had made plans to kill a fourth soldier Wednesday and two Toulouse policemen at a later date, Molins told reporters.

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

In a 2 a.m. 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. 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.