A senior French police officer and his partner were killed in a night-time attack by a knife-wielding man in a distant suburb of Paris, officials said.

The attacker was also killed, while a young boy was rescued from the scene.

The police commander was stabbed to death outside his home in Magnanville, about 35 miles (55 kilometres) west of Paris, the interior minister's spokesman Pierre-Henry Brandet told reporters outside the scene on Monday night (local time).

The attacker then retreated indoors before elite police commandos stormed the residence. The woman and the attacker were found dead; a little boy was found unharmed.

"The toll is a heavy one," Brandet told reporters, his voice shaking with emotion.

"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."

The identity and the motive of the assailant were not immediately clear.

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.

Cazeneuve's statement said that an investigation was under way.