France raised its threat level on Friday, hours after a teacher was killed and two others severely wounded in a knife attack in the northern city of Arras.
President Emmanuel Macron said a second attack had been prevented in another part of France as he condemned the "barbarity of Islamist terrorism" after the killing.
The teacher had "undoubtedly saved many lives" in facing down the attacker, Mr Macron said.
Interior Minister Gerald Darmanin said France was now on its highest state of alert and that the Arras attack was connected to events in the Middle East.
The attacker has been identified by French authorities as a man of Chechen origin who was under surveillance by security services over suspected radicalisation.
Anti-terrorism prosecutors were leading the investigation into the stabbings at the Gambetta-Carnot school, which has pupils aged 11 to 18.
A colleague and a fellow teacher identified the educator who was killed as Dominique Bernard, a French language teacher at the school.
Mr Macron, who visited the school hours after the attack, said the victim “stepped in and probably saved many lives.”
The killing comes amid tensions around the world over the war between Israel and Hamas, including in France where some protests have turned violent.
It also happened almost three years after another teacher, Samuel Paty, was beheaded by a radicalised Chechen near a Paris-area school.
Police described the attacker in Friday's killing as a Russian citizen of Chechen origin who was born in 2003.
French intelligence services said the man had been closely watched since the summer and was stopped as recently as Thursday for a police check that found no wrongdoing, AP reported.
Sliman Hamzi, a police officer who was one of the first on the scene, said he saw a male victim lying on the ground outside the school and the attacker being taken away.
“Colleagues arrived quickly but unfortunately couldn’t save the victim,” he said. “I’m extremely shocked by what I saw.”
Newspaper La Voix du Nord reported that the school's assistant principal and a PE teacher were both seriously wounded in the attack. A French language teacher who tried to intervene was killed, it said.
A security guard was also stabbed “multiple times”, according to AFP, but no pupils at the Gambetta high school were harmed.
“We're all in a state of shock,” said philosophy teacher Martin Doussau, who was chased by the attacker but managed to escape unharmed after locking himself in a room.
Mr Doussau said he saw the assailant going after the school's cook in the yard during a break between two classes before the attacker headed towards him.
“It's when I left that I discovered that one of our colleagues had been stabbed in the carotid artery and died in front of the school,” he told Reuters.
“He was looking for a history teacher,” Mr Doussau said. “That's what leaves me thinking this wasn't related to a personal problem, or about settling a personal vendetta with a teacher.”
A security alert was also triggered later at another school in Arras, a school worker told Reuters.
A man was arrested in that incident, when he tried to enter the school with a suspicious backpack, French media reported.
Education Minister Gabriel Attal said security would be stepped up in schools throughout France.
The country has suffered a series of attacks by extremists since 2015.
Most recently, the beheading of teacher Mr Paty in 2020 near his school in a Paris suburb by a radicalised Chechen refugee led to a wave of shock and renewed debate about the influence of radical Islam.
Such school attacks are rare in France and the motive was not immediately clear.
It came amid heightened tensions around the world over Hamas's weekend attack on southern Israel and Israel's military response, in which hundreds of civilians on both sides have been killed.
France has the largest Muslim population in Western Europe, as well as the continent's largest Jewish community, with thousands of dual citizens living in Israel.
On Thursday, France banned pro-Palestinian protests, fearing they would “generate disturbances to public order” after the Hamas attack on Israel.