A psychologically troubled man with links to radical Islam has been detained in southern France suspected of plotting possible attacks on American and Russian tourists and police, authorities said Thursday, amid renewed fears about Islamic State threats to France.

The man has been under surveillance for radicalism after bragging online about wanting to kill people, and has an "unstable" psychological profile, a security official said. He was detained by intelligence agents earlier this week at the train station in the medieval city of Carcassonne with a knife and a hammer, the official said.

The security official called it a routine matter as police and intelligence services seek to avert a repeat of deadly Islamic State attacks on France last year.

A judicial official said the man told investigators he wanted to attack tourists and later police. Both officials spoke only on condition of anonymity to be able to discuss an ongoing investigation.

The incident came the same week that an extremist claiming allegiance to IS stabbed two police officials to death in a Paris suburb.

Hundreds of police, friends and neighbors marched silently Thursday to honor the victims, police commander Jean-Baptiste Salvaing and his companion, police administrator Jessica Schneider.

Their faces solemn and lips closed, the crowd marched from Mantes-la-Jolie, where Schneider worked, to Magnanville, where she and Salvaing were stabbed at their home Monday night.

Their 3-year-old son survived the attack, which rattled France's leadership as the country is on high alert for new extremist violence.

Attacker Larossi Abballa was killed in a police raid. Three people with links to Abballa are in custody and being questioned by anti-terrorism investigators.

French police have described growing fear after multiple attacks targeting security officers.