The attack revived French concerns about the threat of ISIS after the group targeted Paris last year.
Fighting terrorism is "a long war to wage not just in a few countries but in the whole world, everyone can be concerned," President Francois Hollande said in a speech at the Elysee Palace.
"I said we were at war, that this war will take a generation, that it will be long," Prime Minister Manuel Valls said on France Inter radio.
"Other innocent people will die. It is very hard to say. People can accuse me — and I completely understand — of making the society even more fearful than it already is today with these events. But unfortunately, this is the reality. It will take a generation," Valls said.
The Paris suburb of Magnanville is holding a memorial ceremony for Jean-Baptiste Savaing, the 42-year-old police commander who was stabbed outside his house Monday night, and his 36-year-old female companion, a police administrator whose name has not been released.