TREBES, France (AP) — A French bishop paid tribute Sunday to a police officer who lost his life after swapping himself with a supermarket employee held hostage by an Islamist extremist, saying his heroic sacrifice helped save the nation.

Survivors and families of the four victims of Friday’s rampage of attacks packed the Saint-Etienne-de-Trebes church for the special Mass honoring Lt. Col. Arnaud Beltrame.

Members of the region’s Muslim community were among those mourning at the special Palm Sunday service in the southern town of Trebes, near the medieval city of Carcassonne. The manager of the supermarket sat in the front row, alongside her husband, the town mayor.

The bishop of Carcassonne and Narbonne, Alain Planet, hailed Beltrame’s “extraordinary act, extraordinary devotion.”

“It is better that one man dies for the people, so that the nation doesn’t perish,” the bishop said. He added that the horrific slayings have forced everyone to confront the reality of death and suffering across the world, noting turmoil in Sudan, the Middle East and elsewhere.

The Islamic State group claimed that the attacker — Radouane Lakdim, 25, born in Morocco — was answering its call to target nations in the U.S.-led coalition fighting IS militants in Syria and Iraq.

Lakdim was killed by police Friday after Beltrame helped them storm the market. Lakdim also killed the supermarket’s butcher, a shopper and a passenger in the car that Lakdim had hijacked earlier in nearby Carcassonne. He shot at riot police, one of whom was injured, then headed to the supermarket in Trebes.

Two people have been detained for questioning in the case.

French police searching Lakdim’s home in Carcassonne found notes referring to the Islamic State group that appeared to be a final testament, a judicial official said on Saturday. Also found were a computer and telephone.

Three homemade explosive devices, a handgun and a hunting knife were discovered inside the supermarket, suggesting the attacker may have had still deadlier plans.

The head of France’s National Gendarmerie, Gen. Richard Lizurey, visited the post in nearby Carcassonne where Beltrame had been stationed since August 2017. He said the Lt. Col.’s “exceptional act” should serve as an inspiration to colleagues.

Split-second decisions in a crisis can override protocol, he said.

“(A gendarme) has only a few seconds to act, to make the right decision,” Lizurey said.

He hailed police forces as “the cement of society” but said facing “terrorism is not an individual fight. It’s a collective struggle.”

Moussa Azidad, a teacher in Trebes, said fellow Muslims must send a message to show they, too, must be present in the fight against terror.

“We are part of France, we are French … so we have to, during very difficult times like these, we have to be there,” he said.

French President Emmanuel Macron has ordered a national memorial for Beltrame.

Across the Atlantic, U.S. President Donald Trump said Sunday on Twitter the deadly shooting in southern France showed the need for stronger measures in the fight against the Islamic State group, including border security.

Trump tweeted “France honors a great hero,” citing the bravery of Beltrame. He went on to say there’s “so much bravery around the world” in the fight against IS but added “Even stronger measures needed, especially at borders!”