French police have killed a gunman who shot dead at least three people and injured two others in a hostage-taking and shooting spree in southwest France, security sources said.
A policeman involved in the freeing of all of the hostages at the Super U supermarket in the town of Trebes was injured during the operation to kill the gunman, the source added, asking not to be named.
French investigators suspect the gunman who took people hostage at a supermarket on Friday was a Moroccan man who had been flagged as a potential extremist, a security source said.
Armed police were also responding to the earlier shooting of a policeman in the town of Carcassonne, 15 minutes drive away, which took place at around 11 am (1000 GMT).
The same car has been linked to the hostage-taking and the police shooting.
In Trebes, a picturesque medieval town of around 5,000 people, the man "entered the Super U supermarket at around 11.15 am and shots were heard," a source told AFP on condition of anonymity.
A witness reported he shouted "Allahu Akbar" (God is greatest) before going into the premises, the source added.
Islamic State claims attack
The Islamic State jihadist group claimed responsibility for a shooting spree and hostage siege, its propaganda agency said.
"The person who carried out the attack in Trebes in southern France is a soldier of the Islamic State and he carried out the operation in response to a call to target states" of the anti-IS international coalition, the Amaq agency said in a statement on social messenging app Telegram.
The gunman claimed allegiance to the Islamic State group, the local prosecutor's office said, and the incident was being treated as a terror attack.
Local authorities tweeted that the area around the supermarket was off-limits to the public, while Prime Minister Edouard Philippe said it was a "serious" incident.
The shootings come with France still on high alert after a string of jihadist attacks since 2015, starting in January that year with the assault on satirical magazine Charlie Hebdo that left 12 people dead.
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 Riviera resort of Nice, killing 84 people.
A state of emergency put in place just after the Paris attacks was finally lifted in October last year, but soldiers continue to patrol major tourist sites and transport hubs under an anti-terror mission.
If the link to Islamic State is confirmed, the hostage-taking would be the first deadly attack in France since October, when two young women were stabbed to death outside Marseille's main train station.
Interior Minister Gerard Collomb was heading to the scene, he wrote on Twitter.
The area of southwest France where Friday's shootings took place has been scarred by Islamic extremism before.
In 2012, Mohamed Merah shot dead seven people including three Jewish schoolchildren in the nearby city of Toulouse.
There are two victims in a hostage-taking at a supermarket in Trebes in southern France, the mayor of the town said on Friday (March 23) as La Depeche du Midi newspaper reported one person was dead. (Reuters,Others)
A gunman claiming allegiance to the Islamic State group opened fire and took hostages at a supermarket in southwest France ||A witness reported he shouted 'Allahu Akbar' (God is greatest) before going into the premises, a source said