A knife-wielding attacker who pledged allegiance to Islamic State has stabbed a French police commander and his wife to death at their home.

The 42-year-old police chief was knifed nine times in the stomach in front of the house in the Paris suburb of Magnanville before the killer stormed inside and took his wife and three-year-old son hostage.

His wife was later found dead after special forces raided the property and killed the attacker amid a series of loud explosions after he barricaded himself inside.

The child was rescued “in shock but unharmed” following the incident at about 9pm on Monday, French prosecutors said.

Islamic State’s Amaq news agency said the group claimed responsibility for the attack.

In a post on its website, it said: "Source to Amaq agency: Islamic State fighter kills deputy chief of the police station in the city of Les Mureaux and his wife."

The unnamed police officer, who lives in the suburb 30 miles north of Paris, was stationed in the town of Les Mureaux.

Police and judicial sources said that the attacker was a 25-year-old man who had been monitored by security and anti-terrorist services after he received a three-year prison sentence in 2013 for helping Islamist militants go to Pakistan.

A judicial source said the anti-terrorism unit of the prosecutor's office had been given responsibility for the investigation because of comments made during lengthy exchanges between the assailant and negotiators.

President Francois Hollande held an early morning emergency meeting following the killings.

If it is confirmed Islamic State was behind the murders, it would be the first militant strike on French soil since the government imposed a state of emergency after the terror strikes on Paris in November that killed 130 people.

Monday's killings took place as France, which is currently behind air strikes against Islamic State, was already on high alert for terrorist attacks during the Euro 2016 soccer tournament which began on Friday.

Claims of responsibility from Islamic State come a day after the group claimed it was behind the massacre at Orlando’s Pulse nightclub which left 49 dead.

Additional reporting by agencies