PARIS — Eight days after the police shot dead the self-confessed killer of four Jews and three French paratroopers in Toulouse, the French police on Friday detained 17 people described as Islamic militants in that city and other parts of France.

The French president, Nicolas Sarkozy, said that the detentions were not directly related to the killings in Toulouse, where the gunman, Mohammed Merah, claimed membership in Al Qaeda and was killed by the police as he resisted arrest.

The raids appeared to have two purposes. The first was to “kick the ant pile,” as the French say — a preventive act to detain a variety of people and interrogate them, to try to ensure that there are no further plots under way and no copycat killings. The president said some Kalashnikov assault rifles had been seized.