Mr Macron visited the school in Arras and condemned the “barbarity of Islamist terrorism”.
He called on French people to stay “united” in the face of the attack, to “not give in to terror or let anything divide us”.
Witnesses said the killer, who was a former pupil at the school, shouted “Allahu Akbar”, or “God is greatest”, during the attack.
He is now in custody under questioning by counter-terror police.
The “attack emergency” level in France has been used in previous counter-terror cases.
The alert can trigger extra security patrols, surveillance, and public warnings.
Interior Minister Gérald Darmanin said there was “no doubt” a link between the Arras attack and the Israel-Hamas conflict.
The attacker, named in France as 20-year-old Russian national Mohamed Mogouchkov, is of Chechen origin and known to the security services for his involvement with Islamist extremism, according to French police.
The man killed was a French language teacher, while another teacher and a security guard were seriously wounded and are now in hospital.
Mr Macron said the teacher had “come forward to protect others and without doubt saved many lives”.
Martin Dousseau, a teacher who witnessed the attack, told AFP news agency of “a moment of panic during break-time, when the schoolchildren found themselves face-to-face with the armed man”.
“He attacked canteen staff. I wanted to go down to intervene, he turned to me, chased me and asked me if I was a history and geography teacher,” Mr Dousseau said. “We barricaded ourselves in, then the police arrived and immobilised him.”
The attack comes nearly three years since the murder and beheading of another teacher, Samuel Paty, at his school outside Paris.
The perpetrator of that attack, 18-year-old Abdullakh Anzorov, a Russian Muslim refugee, was shot dead by police shortly afterwards.
France has been hit by a series of Islamist attacks in recent years.
The most serious was in November 2015 when gunmen and suicide bombers attacked entertainment venues and cafes in Paris, killing 130 people. The atrocity was claimed by the Islamic State (IS) group.