A French police officer who traded places with a hostage during a standoff with a gunman Friday has died. Three other people were killed and several others injured in the attack, which roiled the country that has borne the brunt of Europe’s recent struggle with terrorist violence

Arnaud Beltrame, 44, a lieutenant colonel in the French police, succumbed to his injuries early Saturday.

“France will never forget his heroism, his bravery, his sacrifice,” French Interior Minister Gérard Collomb wrote in a tweet confirming Beltrame’s death.

The violence began Friday morning when the gunman hijacked a car near the southwestern town of Carcassonne and then shot at a group of four national police officers returning from a morning jog, wounding one of them. He then drove to the nearby town of ­Trèbes, not far from Toulouse, where he stormed into a supermarket, opened fire and held employees and customers hostage for several hours.

By midafternoon, police had shot and killed the gunman, Collomb announced.

In addition to Beltrame, a person in the hijacked car was killed, as were two other people at the supermarket.

Collomb identified the gunman as a 26-year-old local petty criminal and drug dealer who was a native of Carcassonne.

French President Emmanuel Macron said he considered the incident to be a terrorist attack and on Saturday called on the French to remember Beltrame and “honor his memory.”

It was one of the first significant national security incidents during Macron’s tenure and one of the first attacks since his administration made permanent the government’s “state of emergency” regime of heightened security measures. Collomb quickly made his way to the scene, as did François Molins, the Paris prosecutor, whose office handles terrorism cases nationwide.

According to French media reports, the attacker, whom Collomb named as Redouane Lakdim, claimed to be connected to the Islamic State as he entered the store. After Lakdim was killed by French authorities, the Islamic State — through its Amaq news arm — identified him as a “soldier” and asserted responsibility for the shooting in Carcassonne and the assault on the Trèbes supermarket. The group has made similar claims even when attackers may have been only loosely inspired by the Islamic State or had no verifiable connections to the group.

In other reports, Lakdim was cited as having acted on behalf of Salah Abdeslam, the last surviving member of the Islamic State-affiliated terrorist cell blamed for the November 2015 attacks in Paris and the March 2016 attacks in Brussels. Abdeslam is imprisoned in France and was recently brought to trial in Belgium, where he was arrested in March 2016 after months of eluding European authorities.

In his remarks, Collomb did not explicitly confirm the connection between Lakdim and Abdeslam; he spoke only on a general level, saying that among Lakdim’s motives had been the “liberation of prisoners.”

Collomb disputed the notion that Lakdim was actively involved with the Islamic State. “We do not think there was radicalization,” he said.

For security analysts, Friday’s violence fit into an emerging pattern of attacks targeting police and military officers.

“These are high-value targets,” Jean-Charles Brisard, director of the Center for the Analysis of Terrorism, a Paris-based security think tank, said in an interview. He said his group’s research showed that nearly 70 percent of the terrorist incidents and plots perpetrated or hatched in France in 2017 were ultimately against police or military personnel.

In February 2017, a man attacked a security patrol of France’s “Sentinelle” officers outside the Louvre museum. In March 2017, a man — later shot and killed — attempted to attack a police officer at Paris’s Orly Airport. And in April 2017, on the eve of the first round of that year’s French presidential election, a man attacked and killed a 37-year-old policeman named Xavier Jugelé as he sat in a parked patrol van on Paris’s storied Champs-Élysées.

“They claim to be combatants,” Brisard said of the attackers, “and they target people who have an important symbolism for those who want to see themselves as dying as martyrs.”

The hostage scenario at the supermarket also recalled a January 2015 attack on the Hyper Cacher kosher supermarket in Paris in which four people were killed. In that case, the perpetrator — in a posthumously released video — also declared his allegiance to the Islamic State, but his contacts with the terrorist organization before the attack were unclear.

Since January 2015, more than 230 people have been killed in a string of violent incidents that included the November 2015 Paris attacks, as well as the July 2016 truck attack in Nice, where a driver plowed through crowds celebrating Bastille Day, France's national holiday. Smaller-scale terrorist incidents have since continued, and the French government regularly reports foiled terrorist plots.