A French police commander was stabbed to death while his partner and their young son were held hostage in their home outside Paris. The partner was also killed.

PARIS — The suspect in the killings of a police commander and his partner in a Paris suburb pledged allegiance to the Islamic State and threatened to kill non-believers, the Paris prosecutor said.

François Molins told a news conference Tuesday that the suspect was responding to a communique by the militant group calling on followers to attack people in their homes.

The commander, 42, was stabbed to death outside his home in Magnanville, about 35 miles northwest of central Paris on Monday evening, officials said. He was dressed in plain clothes.

The attacker, identified as Larossi Abbala, 25, by local media and the Associated Press, entered the house and held the commander’s partner and their 3-year-old son hostage, Interior Minister Bernard Cazeneuve said, adding that the partner also worked for the Interior Ministry.

President François Hollande on Tuesday said the killings were “incontestably a terrorist act.” He said that France was facing a terror threat “of a very large scale.”

“France is not the only country concerned, as we have seen, again, in the United States, in Orlando,” Hollande said.

Molins said the attacker posted a 12-minute video claiming responsibility for the killings on Facebook. He said he also posted two tweets during the evening. Three knives were seized including one covered in blood and a Koran was found in a car near the scene, Molins said.

An elite police unit negotiated with the attacker who said he was a soldier for the Islamic State, also known as ISIS and ISIL, French officials confirmed. Police stormed the house and killed the attacker. The woman was found dead. Molins said the young boy was found safe and well but was “very shocked.” He was taken to hospital.

Abbala was previously convicted of terrorism for recruiting fighters for jihad in Pakistan, according to the Associated Press and local media.

The Islamic State’s Amaq news agency said an ISIL fighter carried out the attack, citing an unnamed source.

“We are overcome with grief, he was a commanding officer at the Mureaux Station and she was secretary to the Mantes La Jolie commissioner,” Serge Morvan, the police chief of the Yvelines district — where Magnanville is located — told France 24.

“We are stunned, shocked, devastated,” said Loic Fanouillere, administrative chief of the Alliance Police Union, the largest police union in France.

“A policeman is prepared for the ultimate risk — it is the type of job where you are not 100% sure you will come home in the evening… but now when your own family is hurt? “An attack on the policeman’s family, because he is a policeman, … this is something we never imagined could happen,” he said.

“These people (the Islamic State) are very organized,” Fanouillere added. “There are no lone wolves — they are anything but idiots, they know  what they are doing very well and all their actions are carefully prepared and … unfortunately for us today, unstoppable.”

Terrorists have targeted police in France before.

Two police officers were killed in the attacks in Paris in January 2015 that started with an assault on the offices of the satirical magazine Charlie Hebdo. On the one-year anniversary of those attacks, a man with a knife tried to enter a police station in Paris wearing a fake suicide vest before being killed by police.

Monday’s incident is the first terror attack in France since a state of emergency was implemented following November’s massacre in Paris that killed 130 people. It occurred during heightened security measures for the Euro 2016 soccer tournament. Cazeneuve said more than 100 people who were potentially a threat to the nation have been arrested in recent weeks.

Police officials had already expressed concern in the weeks leading up to the Euro 2016 over potential attacks.

Yves Lefebvre, the leader of a local police union in Paris, said the biggest threat during the tournament was “unfortunately the terrorist attacks.”

Olivier Duran, a spokesman for the National Union of Security Companies which represents private security firms, said that authorities chose to concentrate “huge security measures” on the open-access fan zones during the tournament. “But terrorism strikes out blindly and sometimes cleverly and looks for alternative targets to those high-security locations,” he said.

The terror attack follows a shooting in Orlando early Sunday that killed 49 people. U.S. authorities said the gunman, Omar Mateen, claimed his attack was in support of ISIL but also expressed support for al-Nusra and other rogue organizations that are enemies of the militant group.

Contributing: Jane Onyanga-Omara in London