A pupil at a school near the southern city of Marseille shot and wounded two teachers on Monday with a hunting rifle that had been hidden in a guitar case, causing panic as children ran for cover, officials said.
The anti-terrorism prosecutor's office said on Tuesday the Marseille Prosecutor's Office had decided to relinquish jurisdiction for the case.
"Initial investigations, including an analysis of the minor's digital devices, indicate probable affiliation with the True Crime Community (TCC) movement and suggest that the criminal act committed at his school was motivated by this ideology," the prosecutor said in a statement on Tuesday.
"The TCC is an ecosystem of online communities that glorifies perpetrators of mass killings and, in certain ways, incites the use of extreme violence," it added.
It said it had opened investigations into charges of "attempted murder in connection with a terrorist enterprise, participation in a terrorist criminal conspiracy with the intent to commit crimes against persons, and violations of weapons laws in connection with a terrorist enterprise".
During questioning, the 14-year-old spoke of feelings of revenge towards teachers and expressed regret, broadcaster BFMTV reported, citing investigative sources.
He said he had felt a certain unease at his school and in his private life, and that he disliked the headmaster because of the way he spoke to him.
Citing investigators, BFMTV also reported that several hunting rifles were found at the pupil's family home, which the father - a former competitive shooter and soldier - kept legally in a locked gun cabinet.
The pupil said he had stolen the key to the cabinet in order to get hold of one of the hunting rifles.
with DPA