THREE people are dead after a man attacked and stabbed a policeman and held his wife and young son hostage.

The man who claimed allegiance to the Islamic State group stabbed a French police officer to death before he was killed in a dramatic police operation.

Le Parisien reports that many shots and explosions were heard at the house in Magnanville about 55km west of Paris.

A news agency linked to IS said the attack had been carried out by an “Islamic State fighter”, days after posting a similar claim following the massacre at a gay club in Orlando, Florida.

French prosecutors launched an anti-terror probe after the couple were killed at their home.

The wife and son of the slain police officer were inside with the man who then killed the policeman’s wife.

A spokesman for France’s interior minister confirmed that a police officer, a woman and their attacker were killed following the stabbing.

The spokesman, Pierre-Henry Brandet, told reporters that police managed to rescue a child from the scene. The policeman’s son is just three years old.

Mr Brandet said the child was shocked and receiving treatment.

The boy was rescued after elite police stormed the house.

“Negotiations were opened but it became clear that they would not succeed and police then entered the home, where they found the body of a woman,” Mr Brandet said.

“The toll is a heavy one. This commander, this police officer was killed by the individual ... (and) we discovered the body of a woman. The assailant, the criminal was killed. Thankfully, a little boy was saved.

“He was in the house. He’s safe and sound. He was saved by police officers.”

Police said the man was holed up with the hostages in the policeman’s home in Magnanville, northwest of the French capital.

Paris journalist Peter Allen tweeted the 42-year-old officer was stabbed to death before being killed by police commandos.

Jean-Baptiste Salvaing murdered alongside wife, also in police, before attacker himself killed by Raid commandoes.Couple's 3-yr-old survives — Peter Allen (@peterallenparis) June 13, 2016

French police commander Jean-Baptiste Salvaing, 42, stabbed to death at his home in Magnanville, north of Paris, tonight. — Peter Allen (@peterallenparis) June 13, 2016

The stand-off took place after the attacker stabbed the officer repeatedly outside the property as he returned home.

The police officer who was killed was identified by local media as 42-year-old commander Jean-Baptiste Salvaing, BNO News reports.

As the tense drama unfolded a bystander tweeted a picture of police cars arriving at the scene.

❗YVELINES: Suivi - L'individu est retranché au domicile de la conjointe et l'enfant du policier. |@sozDraken pic.twitter.com/gdLGU9sxLD — Infos Françaises (@InfosFrancaises) June 13, 2016

UPDATE - @AFP - A man has taken the wife and son of a policeman hostage in the Paris suburbs after stabbing the officer to death. — Andrew Beatty (@AndrewBeatty) June 13, 2016

The stand-off began at 8.30pm local time when the policeman was approached outside his home and stabbed.

He then took the officer’s wife and son hostage inside their home.

Police tried to negotiate with the attacker several times, however he reportedly refused to talk to police negotiators, Le Parisien reported.

Shots were then heard coming from the house.

❗YVELINES : Un commandant de police tué devant chez lui à Magnanville, prise d'otages, RAID sur place. |@sozDraken pic.twitter.com/x25Oq5qn40 — Infos Françaises (@InfosFrancaises) June 13, 2016

The attacker has been described by some sources as a neighbour of the policeman, UK newspaper The Telegraph reports and is aged in his late teens or early 20s.

It is understood the officer was dressed in plain clothes when he was reportedly stabbed nine times.

The identity and the motive of the assailant were not immediately clear, Associated Press reported.

France, like other countries in Europe, has seen a wave of jihadist violence — often stabbings — aimed at police officers or soldiers.

France’s Interior Minister Bernard Cazeneuve said in a statement that the man was a police commander and that his wife also worked for the Interior Ministry.

Reuters France reported that neighbours thought they heard the killer chant Islamic phrases.

According to The Telegraph the policeman and his wife were killed in the knife attack as the man reportedly shouted “Allahu Akhbar”.