ROME — Pope Francis joined leaders praising a French police officer who “gave his life out of a desire to protect people” during a terrorist attack.

Lt. Col. Arnaud Beltrame, 44, had convinced the gunman, identified as Redouane Lakdim, to allow him to take the place of a woman Lakdim was holding hostage March 23 in a grocery store in Trebes, a small town in southern France.

Lakdim had already killed the passenger in a car he had hijacked in the nearby town of Carcassonne and had shot at a group of police who were jogging near their barracks, injuring one of the officers. He then drove to the grocery store and reportedly entered shouting that he was part of the Islamic State group. Lakdim killed the store’s butcher and a shopper.

A photo of Lt. Col. Arnaud Beltrame placed on a bunch of flowers at the main gate of the Police headquarters in Carcassonne, France, Saturday, March 24, 2018, following an attack on a supermarket in Trebes in the south of the country on Friday. A French police officer who offered himself up to an Islamic extremist gunman in exchange for a hostage died of his injuries, raising the death toll in the attack to four, and the officer was honored Saturday as a national hero of “exceptional courage and selflessness.” (Credit\: Emilio Morenatti/AP.)

Although police managed to get Lakdim to let other shoppers leave, he kept one woman with him as a human shield. Beltrame offered to take her place and, media reported, he left his mobile phone on a table with an open line so that police outside could hear what was happening. When they heard more gunshots, the police stormed the supermarket and killed Lakdim. Beltrame was seriously wounded and died later in a local hospital.

Bishop Alain Planet of Carcassonne and Narbonne celebrated a memorial Mass for the police officer March 25 in Trebes. According to the BBC, the bishop compared Beltrame to St. Maximilian Kolbe, who died at the Nazi’s Auschwitz death camp in Poland after volunteering to take the place of another prisoner.

Francis sent a message of condolence to Planet, expressing his sadness over what occurred, entrusting the victims to God’s mercy and praying for the families of the victims.

“I particularly recognize the generous and heroic act of Lieutenant-Colonel Arnaud Beltrame who gave his life out of a desire to protect people,” the pope told the bishop.

“I condemn again such acts of indiscriminate violence which cause so much suffering,” the pope said, and pray to God for the gift of peace.