Updated Saturday at 12:50 p.m. ET

A French police officer who was severely wounded on Friday after exchanging himself for a gunman's hostage has died of his injuries, raising the death toll in the attack to four, according to French Interior Minister Gerard Collomb.

Col. Arnaud Beltrame, 44, was one of the first police officers to respond to the attack on a supermarket in southern France, which began after a gunman killed one victim in a carjacking, then killed two others in the grocery store. Sixteen others were also wounded in the attack.

An official with the police union told The Associated Press that the suspect was shot to death when police raided the market in the town of Trebes.

Reuters reports that Mayor Eric Menassi told LCI TV that the man had entered the store yelling, "Allahu Akbar, I'll kill you all."

Collomb said Beltrame offered himself in a hostage swap and then managed to leave his cellphone on after he entered the supermarket and stayed with the suspect — which allowed for contact with officers outside, the AP reports. When police raided the building after hearing gunfire, they discovered that Beltrame had been shot three times, according to Reuters.

"Arnaud Beltrame died in the service of the nation to which he had already given so much," French 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."

President Trump also expressed his condolences in a tweet on Saturday.

"Our thoughts and prayers are with the victims of the horrible attack in France yesterday, and we grieve the nation's loss," Trump tweeted. "We also condemn the violent actions of the attacker and anyone who would provide him support."

The attack may be linked to an earlier incident in the nearby city of Carcassonne. Prime Minister Édouard Philippe said that the suspect earlier fired at police officers on Friday morning, The New York Times reports. The officers were returning from jogging and were wearing athletic clothing with police insignia, the AP reports. One of the officers was shot in the shoulder, but the injury is not life-threatening, a police spokesman told the news service.

Speaking at a press conference during a European Union summit in Brussels, Macron said that the incident appears to be a terror attack, after "what was first an attack against police officers."

Collomb identified the suspect as 26-year-old Redouane Lakdim, describing him as a petty criminal from Carcassonne. Collomb said the suspect had radicalized and was under police surveillance, according to the AP.

"Collomb said Lakdim in the standoff requested the release of the sole surviving assailant of Nov. 13, 2015, attacks in Paris that left 130 people dead," the AP reports.

Police officers, soldiers, security officers have been increasingly targeted in terrorist attacks in France, as Jake Cigainero reports for NPR:

"Last April, a policeman was shot and killed on the Champs-Elysée. Attacks over the last two years have included a police commander and his girlfriend murdered in their home, as well as attacks on soldiers patrolling at the Louvre, Notre Dame and Orly airport."

Trebes is a usually sleepy town of about 5,500 in the Pyrenees near the Spanish border.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.