Three people were killed and 16 others injured in an attack by a lone gunman in southern France, French President Emmanuel Macron has said, calling the act ‘Islamic terrorism.’

UPDATE: Paris says supermarket attacker known only for petty crimes as ISIS claims responsibility

Macron said the investigators will look into Islamic State's (IS, formerly ISIS/ISIL) claim of responsibility for the attack. They will also try to establish how the perpetrator, identified as 26-year-old Redouane Lakdim, became radicalized and how he obtained a gun. Lakdim had a criminal record, but was only known to police for being a petty thief and a drug dealer, while they knew of no jihadist links.

Macron also praised the heroism of a police officer, who offered himself in a hostage swap and was seriously injured, saying the officer “saved lives,” but is now himself in life-threatening condition.

Police are now carrying out raids and searches in the districts around the town of Carcassonne, where Lakdim used to live, BFMTV reported.

The gunman, reportedly of Moroccan origin, first opened fire on four police officers in Carcassonne on Friday morning. He later stormed a supermarket in the nearby town of Trebes, taking numerous hostages.

Lakdim reportedly shouted “Allahu Akbar” as he made his way into the supermarket and demanded the release of Salah Abdeslam, the only surviving terrorist suspect behind the Paris attacks in 2015, who is now in prison awaiting trial.

The gunman is also suspected of killing the driver of a car in Carcassonne and stealing his vehicle before the hostage-taking. The passenger of the vehicle was taken to hospital in a critical condition.

During the hostage crisis, a police officer swapped himself in exchange for one of the hostages in a supermarket. Le Figaro identified him as a 45-year-old lieutenant-colonel, adding he was able to keep his cell phone switched on while inside the shop, and remained in contact with the security forces during the standoff, which lasted several hours.

Elite French units eventually stormed the supermarket after they heard gunshots being fired inside, and killed Lakdim.