PARIS/LES MUREAUX - A suspected Islamist attacker stabbed a French police commander to death outside his home and later killed his companion, a policewoman, in an attack claimed by Islamic State and denounced by the government as "an abject act of terrorism". The assailant, a 25-year-old Frenchman of Moroccan origin, was jailed in 2013 for helping militants go to Pakistan and had been under security service surveillance, including wiretaps, at the time of the attack, police sources said.

The attacker filmed part of the assault live on the social network Facebook, according to David Thomson, a journalist specialised in radical Islamists. In his Facebook message, he linked the attack to the Euro 2016 soccer tournament now under way in France, saying: "The Euros will be a graveyard." The attacker, named by police and justice sources as Larossi Abballa, knifed the 42-year-old commander repeatedly in the stomach on Monday evening.

He then barricaded himself inside the house in Magnanville, a suburb some 60 km west of Paris, taking the man's 36-year-old partner and their three-year-old son hostage.

Police commandos shot Abballa dead when they stormed the house after negotiations failed but they found the woman, a secretary at a police station in a nearby suburb, killed with a knife, a source close to the investigation said. The boy was unharmed but in a state of shock.

"An abject act of terrorism was carried out yesterday in Magnanville," Interior Minister Bernard Cazeneuve said after an emergency government meeting, before visiting Les Mureaux, where the police commander worked. President Francois Hollande said the killings were "undeniably a terrorist act" and that the terrorist threat in France was very high.

Police searched Abballa's home and other locations on Tuesday and detained two people close to him for questioning, a police source said.

The killings came as France, which has been under a state of emergency since Islamic State gunmen and bombers killed 130 people in Paris last November, was on high security alert for the Euro 2016, which began last Friday.

Police are under "extreme pressure" and "close to burn-out," the head of FO labour union Jean-Claude Mailly told France 2 television.

Islamic State claimed the attack. "God has enabled one of the caliphate's soldiers in city of Les Mureaux near Paris to stab to death the deputy police chief and his wife," an official broadcast on its Albayan Radio said.

Man stabs teenager in France

A man with known psychiatric problems stabbed a 19-year-old girl three times in western France on Tuesday, telling police he had heard voices ordering him to make a "sacrifice" for Ramadan, the Rennes prosecutor said.

The attack came a day after a jihadist killed a French police couple in a small town near Paris, in a stabbing inspired by the Islamic State group.

"Voices told him that he had to make a sacrifice on the occasion of Ramadan," the holy Muslim fasting month that began on June 6, prosecutor Nicolas Jacquet told AFP.

The 32-year-old man was immediately assessed by a doctor and sent to a psychiatric hospital after stabbing the girl twice in the wrist and once in the abdomen, Jacquet said, adding that the teenager's wounds are not life-threatening.

The assailant told a witness that he was Muslim before handing over the knife after the attack, Jacquet said.

The man had been in and out of psychiatric wards several times, the prosecutor said, adding that he told investigators he was being treated for schizophrenia and was supposed to receive an injection on Tuesday.

An investigation has been opened into attempted murder.