PARIS (AP) — France’s anti-terror prosecutor said Tuesday that a suspected extremist declared allegiance to the Islamic State group before fatally stabbing a teacher in a school attack last week.

The prosecutor, Jean-François Ricard, said police found an audio recording on the suspect’s phone. The alleged attacker declared allegiance to IS and expressed “his hatred for France, for the French, for democracy and the education he benefitted from in our country.”

The suspect, who was taken into custody after the attack, was a former pupil of the school in the northern town of Arras. A teacher was fatally stabbed in the neck and three other people were wounded in the assault, which prompted France to raise its terror alert level and deploy extra security.

The prosecutor spoke at a news briefing and took no questions.

Ricard said that shortly before the stabbing, the alleged attacker also recorded a 30-second video of himself in front of a war memorial. The prosecutor identified the suspect only as Mohamed M., without his last name — a common practice in French judicial investigations. Court documents reviewed by The Associated Press show the suspect, born in 2003, is from the Ingushetia region in Russia’s Caucasus Mountains, which neighbors Chechnya.

In his video, the suspect “repeatedly attacked, in his own words, the values of the French. He expressed some particularly threatening views,” the prosecutor said.

In the audio message, recorded in Arabic, the suspect also expressed support for Muslims in Iraq, Asia and the Palestinian territories. But he didn’t directly link the school attack to the outbreak of war between the Hamas militant group and Israel, the prosecutor said.

Two of the alleged attacker’s family members, as well as the suspect himself, now face formal terrorism-related charges, Ricard said.

They include the alleged attacker’s 16-year-old younger brother who is suspected of having provided “a certain amount of support” for the assault, of being aware of his older brother’s radicalization and of advising him how to handle knives, according to the prosecutor.

The other is a cousin who was allegedly aware that a crime was possibly being planned, but apparently did nothing to stop it, he said.

Police detained a total of 13 people for questioning in the investigation since last Friday, but 10 of those have been cleared of any wrongdoing for now, the prosecutor said.

French intelligence services said they’d been watching the suspect closely since the summer with tails and phone surveillance, and that he was stopped by police the day before the attack but they couldn’t find any signs of an impending attack, so he was released.