A general view shows gendarmes and police officers at a supermarket after a hostage situation in Trebes, France, March 23, 2018.
TREBES - At least three people were killed Friday when a man claiming allegiance to the Islamic State group went on a shooting spree and held people hostage in a supermarket in southwest France before being shot dead by police.
"Our country has suffered an Islamist terrorist attack," President Emmanuel Macron said in a televised address.
Five people were also shot and injured, two of them in a critical condition, a source close to the investigation said.
A police officer who took the place of a female hostage is "fighting for his life", Macron added, hailing the man as a hero.
What we know so far about hostage situation in Trbes, France:— BBC Breaking News (@BBCBreaking) March 23, 2018
- Elite police surrounding Super U shop, gunman inside
- Shots fired at policemen earlier, wounding one
- Gunman "claims to be in Islamic State group"
Latest: https://t.co/cABeHf80xK pic.twitter.com/6McLy3uTqm
"He saved lives and honoured his colleagues and his country."
The other man in a critical condition is the driver of a car hijacked by the attacker, who authorities have named as 26-year-old Radouane Lakdim.
The shooting spree comes with France still on high alert following a string of jihadist assaults since 2015 that have claimed more than 240 lives.
Lakdim, a drug dealer monitored as a possible Islamist extremist, carried out three separate shootings in the medieval town of Carcassonne and in nearby Trebes where he ended his rampage by taking hostages at a supermarket.
"We had monitored him and did not think he had been radicalised. He was already under surveillance when he suddenly decided to act," Interior Minister Gerard Collomb told reporters after flying to the scene.
Said by security sources to have Moroccan nationality, Lakdim first hijacked a car in Carcassonne, killing a passenger and injuring the driver, before shooting and injuring a policeman who was out jogging with colleagues.
He then drove to a Super U supermarket in the sleepy town of Trebes, shouting "Allahu Akbar" (God is greatest) as he stormed in, a witness reported.
There he killed another two people and took hostages for more than three hours, armed with a knife and a gun, according to survivors. Another witness said he had grenades.
Most of the hostages managed to escape but Lakdim kept one woman back as a human shield.
The heroic officer, one of a group who had rushed to the scene, offered to take her place while police negotiated with Lakdim, who asked for unidentified prisoners to be released.
Lakdim shot the policeman, prompting elite anti-terror officers to swoop on the building and shoot the attacker dead.
Another officer from the anti-terror force was also injured during the raid.
"People were in complete peace here," Collomb said in Trebes, a picturesque town of 5,000 people along the famed Canal du Midi.
"No one could have imagined that there could be an attack."
Paris Mayor Anne Hidalgo announced that the Eiffel Tower would switch off its light at midnight to honour the victims.
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 jihadists.
Friday&39;s violence 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 jihadist, Mohamed Merah, shot dead seven people including three Jewish schoolchildren.
That assault marked the first of several big Islamist attacks in France, including the January 2015 gun massacre at the offices of satirical newspaper Charlie Hebdo.
France also suffered major attacks in Paris in November 2015 when IS jihadists killed 130 people in bombings and shootings at bars, restaurants, the Bataclan concert venue and the national stadium.
In July 2016, in another attack claimed by IS, a man drove a truck through revellers celebrating Bastille Day in the southern resort of Nice, killing 84 people.
Christian Guibert, a survivor of Friday&39;s attack, said he saw "a man on the ground and then another very animated person who had a gun in one hand and a knife in the other and who was shouting &39;Allah Akbar&39;."
Guibert told BFM television he hid his wife and sister-in-law in a refrigerated meat room in the supermarket and then went to alert the police.
Three helicopters could be seen circling over Trebes throughout the day, while heavily armed police closed down roads surrounding the supermarket.
The attack could reignite France&39;s immigration debate if it is confirmed that the attacker was a foreign national.
In October, a Tunisian man with a history of drug problems and petty crime stabbed to death two women on the steps of Marseille&39;s railway station in southern France while shouting "Allahu Akbar".
The killer, Ahmed Hanachi, did not have papers to be in France and had been arrested for shoplifting just days before but had walked free.
"From Morocco, already imprisoned, a known Islamist already. But still in our country. How far will our laxism go?" the vice-president of France&39;s far-right National Front, Nicolas Bay, wrote on Twitter after Friday&39;s attack.
All but one hostage released, says town mayor amid &39;terror situation&39; in Trebes pic.twitter.com/1vOQOifugU— Ruptly (@Ruptly) March 23, 2018
A state of emergency put in place just after the 2015 Paris attacks was lifted last October when Macron&39;s centrist government passed a new law boosting the powers of security forces.
Soldiers continue to patrol major tourist sites around France and transport hubs under an anti-terror mission.
"We are in a small and calm town, but sadly the threat is everywhere," Collomb said.