The two self-proclaimed "soldiers of ISIS" who stormed a church in northern France during Mass Tuesday and slit the throat of an 85-year-old priest held nuns at gunpoint as they tried to flee, in a dramatic moment caught on video just before police marksmen killed them.

Video posted on the French news site Le Telegramme captures the jihadists, who had earlier pledged allegiance to ISIS, as they spill out of the church, using the nuns as human shields. The killers, identified by police as Adel Kermiche and Abdel Malik, shout “Allahu Akbar” as they run from the church in Saint-Etienne-du-Rouvray, each holding a gun to the head of a nun as police snipers take aim.

The video, which is trained on the church and a parking lot, shows a group of heavily armed French police moving in unison outside the church. Toward the end of the footage, gunshots ring out.

ISIS' Amaq news agency on Wednesday released a video allegedly showing Kermiche and Malik pledging allegiance to the terror group and its leader, Abu Bakr al-Baghdadi. The two men speak in Arabic in the video and are shown seated and wearing traditional Muslim garb. One of the men displays the flag of ISIS.

Authorities in France are working to piece together any security lapses leading up to the attack. France's anti-terrorism prosecutor said one of the men in the attack evaded police twice using relatives' ID cards in attempts to reach Syria.

Paris prosecutor Francois Molins told reporters that Kermiche was wearing an electronic surveillance bracelet when he and another attacker slit the throat of a priest in the town of Saint-Etienne-du-Rouvray Tuesday. Kermiche and the other assailant were killed by police.

Molins said the bracelet was deactivated for a few hours every morning, corresponding with the time of the attack.

He said Kermiche was arrested in Germany in March 2015 trying to join extremists in Syria using his brother's ID, and then was arrested in Turkey two months later using a cousin's ID.

A family friend says Kermiche had a sister who is a doctor in the nearby city of Rouen, and a brother. Their mother is a professor. The family alerted authorities to his radicalism to try to stop him from going to Syria, the friend said.

Molins said the person who was injured in the attack is no longer in life-threatening condition.

French President Francois Hollande is vowing to win his country's war against terrorism.

In a televised address to the nation Tuesday, he said: "To attack a church, kill a priest, is to profane the republic."

The Associated Press contributed to this report.