TRÈBES, France - A French policeman who offered himself as a hostage to help end what President Emmanuel Macron branded an “Islamist terrorist attack” died of his wounds Saturday, becoming the fourth victim of the shooting spree and supermarket siege.

Lieutenant-Colonel Arnaud Beltrame, 45, was among a group of officers who rushed to the scene in the town of Trebes in southwest France on Friday after the attacker, who claimed allegiance to the Islamic State group, stormed a supermarket and fired at shoppers and staff.

Beltrame offered to take the place of a woman who was being held as the attacker’s final hostage, according to Interior Minister Gerard Collomb. Gunman Radouane Lakdim, 25, shot and stabbed the policeman before anti-terror officers moved in to kill the attacker and end the siege.

Macron led a flood of tributes to Beltrame, saying he had “died a hero” and deserved “the respect and admiration of the whole nation”.

Lakdim killed a total of four people in Trebes and the nearby medieval town of Carcassonne, in France’s first major militant attack since October.

The Islamic State group claimed the attack was in response to its call to target Western enemies - as is customary when the assailant has pledged allegiance to the militants. With IS seeking to inspire lone-wolf attacks in its name as its self-proclaimed “caliphate” in Syria and Iraq crumbles, Defence Minister Florence Parly said France would not let up in its pressure on the militants. “The fight against Daesh will continue without relenting,” she said in a statement, using another name for IS.

The shootings come as France remains on high alert following a string of deadly attacks that have killed more than 240 people since 2015.

Lakdim, a Moroccan-born French national, had been monitored as a potential extremist.

Top anti-terror prosecutor Francois Molins said Lakdim had convictions for carrying a banned weapon and for drug use and had spent a month in jail in 2016.

“He had been on a watchlist for his radicalisation and links to the Salafist movement,” Molins told reporters in Carcassonne on Friday, adding that Lakdim had been tracked for his online contacts with extremists.

His partner, who lived with him in Carcassonne, has been detained along with another friend.

Lakdim started his rampage in Carcassonne at around 10:30 am (0930 GMT), hijacking a car and shooting the two people inside.

The passenger was killed, and the driver remains in a critical condition.

Lakdim then shot and wounded a policeman who was out jogging with colleagues before driving to nearby Trebes, bursting into a Super U supermarket and shooting a customer dead along with the store’s butcher. He further demanded the release of certain prisoners - notably, according to a security source, Salah Abdeslam, prime suspect in the November 2015 Paris terror attacks.

The attack has rocked the normally sleepy town of Trebes, which went on lockdown Friday with heavily armed and masked police carrying out a massive operation in Lakdim’s neighbourhood.

Supermarket boss Samia Menassi, whose store remains closed and surrounded by police tape, was still in shock Saturday as she recalled hearing the first gunshots. “I said to the girls, ‘Call the police, there’s a terrorist in the shop,” she told AFP. “We felt powerless because we still had colleagues in there.”

Of around 50 who were in the store at the time, most were able to get out through an emergency exit, some after sheltering in a meat refrigerator.

The shootings took place in a part of France still scarred by a killing spree in 2012 in the city of Toulouse and nearby Montauban where another militant, Mohamed Merah, shot dead seven people including three Jewish schoolchildren.

That assault marked the first of several big Islamist attacks in France since 2015, including the massacre at the satirical newspaper Charlie Hebdo, the November 2015 attacks that killed 130 in Paris, and the 2016 Bastille Day truck attack in Nice.

The most recent assault came in October when a Tunisian man stabbed to death two women at Marseille’s railway station.

A state of emergency put in place just after the 2015 Paris attacks was lifted in October when Macron’s centrist government passed a new law boosting the powers of security forces.

Thousands of French troops remain on the streets under an anti-terror operation known as Sentinelle, patrolling transport hubs, tourist hotspots and other sensitive sites.