Police detained a young man in southern France on Thursday on suspicion that he was planning a revenge attack on the staff of a satirical magazine which published cartoons mocking the Prophet Mohammad.
Anti-terrorism magistrates near the Mediterranean port city of Toulon questioned the 18-year-old after he threatened in a message on Facebook to cut the throats of anyone he could find at the offices of Charlie Hebdo, a judicial source said.
The magazine's publication of cartoons ridiculing Mohammad added to the anger of Muslims already outraged over an anti-Islam film produced in the United States and posted on the Internet.
The suspect had no police record but he was already known to security services, the source said, without giving further details.
Police in France are on high alert for attacks by Islamist militants. They were criticised for failing to stop an al Qaeda-inspired gunman shooting dead seven people in March, including three Jewish children, in the southern city of Toulouse.
The shooter, Mohamed Merah, had been interviewed by police after returning from a visit to Afghanistan and had a violent criminal record.
The government, which has criticised the cartoons, plans to shut schools and diplomatic offices in 20 countries on Friday as a precaution against protests after attacks on U.S. and German embassies, some of them deadly.
Police have refused a request to hold a protest against the film in Paris, after some 150 participants in an illegal demonstration near the U.S embassy were arrested on Sunday. France has Europe's largest population of Muslims.
"People in the suburbs are very upset over the publication of these cartoons," said Mohamed Mechmache, head of the ACLEFEU association for urban youths, created in the wake of riots that swept French suburbs in 2005.
"They feel there is a double standard when it comes to free speech: it's okay to mock the Prophet, but we can't protest against it ... All it would take for things to spiral out of control is a police check that goes wrong."
In another incident which might exacerbate strains, an 18-year-old young French woman was sentenced to two months in jail for refusing to comply with a police identity check while she was wearing a banned full-face veil in public.
The woman resisted police when they asked to check her identity in front of a mosque in central Marseille in July, during the holy Muslim fasting period of Ramadan.
Under a French law from 2010, a person wearing a "burqa" or "niqab" style full-face veil can be stopped by police. If she refuses to remove her veil, she can be fined or sentenced to community service. Repeat offenders face jail.
In addition to being jailed and receiving a six-month suspended prison sentence, the veiled woman was ordered to pay damages of 1,000 euros ($1,300) to a female police officer whom she bit during the altercation.
Two young men who were accompanying the woman were also sentenced to two months' jail for fighting with police when they tried to carry out the identity check.