The suspect has been identified as Larossi Abballa, 25, who had been sentenced to two years six months in jail, plus six months suspended, for "criminal association with the aim of preparing terrorist acts," in a trial with seven other defendants, one of whom was his wife.
He was recently investigated for suspected involvement in a Syrian-linked jihadist network.
Witnesses in Magnanville, 55 kilometres north-west of Paris, told investigators the suspect may have shouted "Allahu akbar (God is great) as he stabbed the policeman repeatedly outside his home before holing up inside with the woman and the couple's three-year-old son.
Loud detonations were heard at the scene as elite Raid police moved in following failed negotiations with the attacker.
The police officer's wife, a police administrative officer, was also murdered and the man shot dead in the police assault.
The couple's toddler son was "in shock but unharmed", a prosecutor added, saying the boy was receiving medical attention.
IS claims responsibility
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 nightclub in Orlando, Florida.
President François Hollande said the attack was "uncontestably terrorist".
France's Interior Minister Bernard Cazeneuve described it as an "appalling terrorist act".
Former president Nicolas Sarkozy, now the leader of the right-wing opposition party, the Republicans, said that France's level of alert had to be adapted immediately.
The country remains under a state of emergency since the November terror attacks in Paris, which killed 130 people.
To read our coverage of last November's Paris attacks, click here