The man suspected of killing two police employees near Paris claimed the act in a video posted online by one of the Islamic State extremist group's media arms, Aamaq, police said Tuesday.
In the video allegedly recorded in the victims' home, the man, named as 25-year-old Larossi Abballa, said he had "just killed the policeman, I have just killed his wife."
"I am surrounded by police at this moment," he said, exhorting others to commit similar acts of violence.
Abballa is under investigation for terrorist-affiliated murder, French prosecutor Francois Molins said at a press conference.
He was killed by French security forces when they raided the police house where he was holed out with the couple's 3-year-old son.
The suspect, who Molins said posted a 12-minute Facebook video during the attack and told police that he had pledged allegiance to the Islamic State group three weeks prior, had already been part of a judicial inquiry opened in February for links to a network encouraging travel to Syria and the surrounding zone.
But Molins said that despite the authorities intercepting Abballa's phone, there had not been specific mention of Monday's attack that would have warranted an arrest prior to the deadly stabbings.
Abballa arrived at the police commander's home in the town of Magnanville, 50 kilometres west of Paris, and knifed him outside his door just after after 8 pm [1800 GMT], Molins said. The commander worked for police forces in Les Mureaux, and his companion, a 36-year-old woman, was an administrator in Mantes-la-Jolie.
She was also killed in the house. The couple's son survived and was taken to hospital in a state of shock, Molins said.
During the video published by Amaq, Abballa pledges allegiance to Islamic State leader Abu Bakr al-Baghdadi. In the recording, which is laced with religious references, Abballa calls in French and Arabic for killings to continue - singling out journalists, politicians and rap musicians - and threatens French authorities.
He also makes unspecified threats about the European football championship, currently underway in France.
According to the SITE monitoring group, which tracks extremist activity online, Islamic State said on Amaq that Abballa was one of its soldiers.
Three men, aged 27, 29 and 44, were detained Tuesday in relation to the killings, Molins said.
French President Francois Hollande said that vigilance would be at its highest level, saying that additional measures would be taken to ensure security. After meeting with ministers earlier at the Elysee for an emergency cabinet meeting, Hollande had said the attack was "an act of incontestable terrorism."
Aside from the most recent investigation, Abballa had been long known to French authorities. He was put into provisional detention in 2011 for links to a Pakistani-Afghan extremist network, and was sentenced in 2013 to a three-year partially suspended imprisonment for association with terrorism, Molins said. But Abballa did not serve additional time after the ruling, having already been jailed.
Molins said that Abballa's prison guards noted that he had proselytized Islamist radicalism while in jail.
Interior Minister Bernard Cazeneuve said after the emergency cabinet meeting that since the beginning of the year, more than 100 people had been arrested who represented a threat to France's security.
Cazeneuve added that the threat of terrorism was "elevated in France, elevated in Europe and elevated in the West, as we have seen with the events that took place 48 hours ago in the US."
On Sunday, the lone gunman who killed 49 people in a gay nightclub in Orlando, Florida, pledged allegiance to Islamic State in an emergency call while the attack was under way.