TREBES, France (AP) – 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 honoured Saturday as a national hero of “exceptional courage and selflessness.”

Col. Arnaud Beltrame was among the first officers to respond to the attack on the supermarket in the south of France on Friday.

Beltrame, who first took his place among the elite police special forces in 2003 and served in Iraq in 2005, had organised a training session in the Aude region in December for just such a hostage situation. At the time, he armed his officers with paintball guns, according to Depeche du Midi, the local newspaper.

“We want to be as close to real conditions as possible,” he said then.

But when he went inside the supermarket on Friday, he had given up his own weapon and volunteered himself in exchange for a female hostage.

Unbeknownst to the Morocco-born captor, he left his mobile phone on so police outside could hear what was happening in the store. They stormed the building when they heard gunshots, officials said. Beltrame was fatally wounded.

His death raises the toll to four. The gunman was also killed, and 15 people were injured in the attack.

“Arnaud Beltrame died in the service of the nation to which he had already given so much,” President Emmanuel Macron said in a statement. “In giving his life to end the deadly plan of a jihadi terrorist, he fell as a hero.”

According to the statement, Beltrame joined the elite police special forces in 2003 and deployed to Iraq in 2005. He served as a member of the presidential guard and in 2012 earned one of France’s highest honours, the Order of Merit. He was married with no children.

Macron has said investigators will focus on establishing how the gunman, identified by prosecutors as Morocco-born Redouane Lakdim, got his weapon and how he became radicalised.

On Friday night, authorities searched a car and the apartment complex in central Carcassonne where Lakdim was believed to live.

Lakdim was known to police for petty crime and drug dealing. But he was also under surveillance and since 2014 was on the so-called Fiche S list, a government register of individuals suspected of being radicalized but who have yet to perform acts of terrorism.

Despite this, Paris prosecutor Francois Molins said there was “no warning sign” that Lakdim would carry out an attack.

A woman close to Lakdim was taken into custody over alleged links with a terrorist enterprise, Molins said. He didn’t identify her.

UPDATE: ‘Allah hu Akbar’ attacker shot dead by police. Three victims dead, a dozen wounded https://t.co/b7GqMO9v6J — Breitbart London (@BreitbartLondon) March 23, 2018

The four-hour drama began at 10:13 a.m. when Lakdim hijacked a car near Carcassonne, killing one person in the car and wounding the other, the prosecutor said.

Lakdim then fired six shots at police officers who were on their way back from jogging near Carcassonne, said Yves Lefebvre, secretary general of SGP Police-FO police union. The police were wearing athletic clothes with police insignia. One officer was hit in the shoulder, but the injury wasn’t serious, Lefebvre said.

Lakdim then went to a Super U supermarket in nearby Trebes, 60 miles (100 kilometres) southeast of Toulouse, shooting and killing two people in the market and taking an unknown number of hostages. Special police units converged on the scene while authorities blocked roads and urged residents to stay away.

He shouted “Allahu Akbar!” — an Arabic phrase meaning ‘Allah is Greater’ — and said he was a “soldier of the Islamic State” as he entered the Super U, where about 50 people were inside, Molins said.

“We heard an explosion — well, several explosions,” shopper Christian Guibbert told reporters. “I went to see what was happening and I saw a man lying on the floor and another person, very agitated, who had a gun in one hand and a knife in the other.”

During the standoff, Lakdim requested the release of Salah Abdeslam, the sole surviving assailant of the November 2015 attacks in Paris that left 130 people dead. The interior minister suggested, however, that Abdeslam’s release wasn’t a key motive for the attack.

The IS-linked Aamaq news agency said the attacker was responding to the group’s calls to target countries in the U.S.-led coalition carrying out airstrikes against IS militants in Syria and Iraq since 2014. France has been repeatedly targeted because of its participation.

France has been on high alert since a series of extremist attacks in 2015 and 2016 that killed more than 200 people. One of those attacks, against a kosher supermarket in Paris, seemed to foreshadow this week’s deadly assault in the south.

___

Associated Press journalists Thomas Adamson, Samuel Petrequin, Sylvie Corbet, Angela Charlton and Jerome Pugmire contributed to this report from Paris.