Macron stood in the drizzle outside the building where three police officers and an administrator were stabbed to death by their own colleague before police fatally shot him. The victims were posthumously given the country’s highest award, the Legion of Honor.
"They had made the choice to wear the uniform, to devote their lives to protecting others. They died in service, at work," said Macron, who has also met privately with families of the victims.
The attacker, a 45-year-old IT administrator in the intelligence unit, was a recent Muslim convert.
While French officials initially said there was nothing to suggest the attacker was tied to extremist groups, prosecutors are now investigating the killings as a potential act of terrorism. The attacker likely had links to members of an ultra-conservative Islamic movement.
"The whole nation (must) unite, mobilize, act... We will only win if our country gets up to fight against this underground Islamism that corrupts the children of France," Macron said.
Interior Minister Christophe Castaner had earlier bestowed the victims with the Legion of Honor. Their coffins, draped with the French flag, were surrounded by police officers.
The ceremony came as justice officials said French investigators found a USB stick belonging to the killer that contained information about his colleagues.
But officials did not immediately confirm several French media reports that the memory stick contained "jihadi propaganda."
Castaner has acknowledged breaches in security over a failure to detect signs that the attacker had been radicalized.
The man had previously "justified" the deadly 2015 Islamic extremist attack on satirical newspaper Charlie Hebdo in front of his colleagues. No written report was made at the time.
The Associated Press contributed to this report.