Friday's killing, coming at the same time as the war between Israel and Hamas, has jangled nerves in France and put the country on high alert for further violence.
The suspected attacker, Mohammed Moguchkov, 20, from a mainly Muslim region of Russia, was charged by an anti-terror judge with murder linked to a terrorist conspiracy, as well as associating with terrorist criminals. He was remanded in custody.
His 16-year-old brother and 15-year-old cousin were also appearing before the judge suspected of assisting him before he stabbed Dominique Bernard, 57, at his former school in Arras, about 180 kilometers north of Paris.
Moguchkov had "sworn allegiance to the Islamic State" in a long audio recording, prosecutor Jean-Francois Ricard told reporters in Paris, adding that further information had been gleaned from people close to him and a video recorded before the assault.
A source familiar with the case said he had made a "very marginal" reference to Gaza in a video following the attack on Israel by Hamas.
Bernard's killing came almost exactly three years after another teacher, Samuel Paty, was beheaded by an Islamist radical from Russia's southern region of Chechnya, which borders the Ingushetia region where Moguchkov was born.
- Bomb threats -
France raised its security level after Friday's attack and deployed 7,000 troops.
There have since been several bomb threats at public buildings -- one at the Arras high school and two at the Palace of Versailles, a major tourist attraction.
With neighbouring Belgium also suffering an attack -- two Swedes were killed by a Tunisian man also claiming inspiration from the Islamic State group -- politicians are warning of a wider threat.
"All European states are vulnerable," French President Emmanuel Macron told reporters in the Albanian capital, Tirana, on Tuesday.
He said "Islamist terrorism" had returned, adding: "We all have a vulnerability. It's what comes with being a democracy, a rule-of-law state where there are individuals who can decide at a given moment to commit the worst acts."
But Macron, who is set to attend schoolteacher Bernard's funeral on Thursday, stressed he had seen "no failures" by French security services ahead of the stabbing in Arras.
The French government has brought forward to December a parliamentary debate on a planned immigration bill, which it says will also act as a response to terrorism.
Interior Minister Gerald Darmanin's office said he was considering adding to the bill measures that would allow any immigrant who "adheres to a jihadist ideology" to be stripped of their residency.
- Seeking expulsions -
France, which has large Muslim and Jewish populations, has been on alert since Hamas attacked Israel on October 7.
Darmanin said on Monday that 102 people had been arrested for anti-Semitic acts or expressing support for terrorism since the assault.
Moguchkov, who reportedly arrived in France aged five, was already on a national register as a potential security threat and under surveillance by France's domestic intelligence agency, the DGSI.
His father, who was also on the list, was deported in 2018.
Macron has called on police to comb through their files of radicalised people who could be deported.
He told Darmanin to focus especially on young men from the Caucasus region of Russia, his aide said.
The interior ministry said on Tuesday it would seek to expel 11 Russians who were on an official list of dangerous radicals.
PARIS - The man who killed a schoolteacher in northern France last week was charged with terror offences on Tuesday, a prosecutor said, after revealing that he had sworn allegiance to the Islamic State extremist group in an audio recording before his attack.