TREBES, France: 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 police and firefighters secure the entrance of Trebes. Picture: AP

France attacker known for petty crimes: minister

The man who killed at least three people in attacks in southern France was a 26-year old known for petty crimes and possession of drugs, Interior Minister Gerard Collomb told reporters, adding that he acted alone.

Collomb named the attacker as Redouane Lakdim and said he was from nearby Carcassonne, where the attacks started.

"He was known for petty crimes. We had monotored him and thought there was no radicalisation," Collomb said.

UAE condemns attack

The UAE has condemned the shooting attack that targeted the French police and the hostage-taking in the southern France city of Trèbes.

In a statement issued on Friday, The Ministry of Foreign Affairs and International Cooperation reaffirmed the UAE’s full solidarity with France in all efforts that it takes to combat violence, extremism and terrorism and to safeguard and protect its people and land.

The Ministry also reiterated the UAE’s firm stance that rejects terrorism in all its forms and manifestations, expressing its sincere condolences to the families of the victims and its wishes of speedy recovery to the injured.

Three killed

Three people were killed in southwestern France on Friday when a gunman held up a car, opened fire on police and then took hostages in a supermarket.

A source at the Interior Ministry said two had died at the hostage-taking in the small town of Trebes. "It is a provisional assessment as it could unfortunately get worse. Three people are wounded, including one of them seriously," the source said.

Later, a police union official said the attacker had also killed one person with bullet in the head in the nearby town of Carcassonne before the hostage-taking.

Prime Minister Edouard Philippe said the incident appeared to be a terrorist act.

Eric Menassi, the mayor of Trebes, told BFM TV that the hostage-taker was now alone with one police officer in the supermarket and all other hostages were free.

The station reported that the hostage-taker has claimed allegiance to Daesh militants and that he has demanded the release of Salah Abdeslam - the prime surviving suspect in the Daesh attacks that killed 130 people in Paris in 2015.

A 45-year-old lieutenant-colonel swapped himself in exchange for one of the hostages, a source close to the investigation said later, confirming information first published by Le Figaro newspaper.

As it unfolded

First the gunman held up a car, killing one person and wounding another. Then he fired on police officers in Carcassone, wounding one officer in the shoulder before heading to Trebes about 8 km to the east, where two more died in the Super-U supermarket.

Menassi also told LCI TV that the man had entered the shop in Trebes and said: "I'll kill you all".

Philippe said: "All the information we have as I speak leads us to think that this would be a terrorist act." Carole, who was shopping at the supermarket, described how people had taken refuge in a cold room.

"A man shouted and fired several times. I saw a cold room door, I asked people to come and take shelter," she told Franceinfo radio. "We were ten, and we stayed an hour. There were more gunshots and we went out the back door." French investigators believe they have identified the hostage-taker. The man is known to the intelligence services and flagged in a database of radicalised militants, Franceinfo reported.

Police in helmets and body armour took up positions around the Super-U supermarket.

The Paris prosecutor's office said counter-terrorism prosecutors were investigating the incident but did not comment on the possible Islamic State allegiance.

Earlier, the Interior Ministry had said security forces were carrying out an operation at a supermarket in southern France. Interior Minister Gerard Collomb was on his way.

The UNSA police union also said on Twitter a police operation was underway after an individual had earlier shot at four officers in the Carcassone region, wounding one of them.

Deadly terror attacks in France since 2015

Here is a recap of the major terrorist attacks that have killed more than 240 people across France since the 2015 Charlie Hebdo shootings.

2017

October 1: A 29-year-old Tunisian kills two young women with a knife at the main train station in the southern city of Marseille.

Ahmed Hanachi is shot dead by soldiers on patrol. His attack is claimed by Daesh militants.

April 20: A 39-year-old ex-convict shoots dead an on-duty policeman and wounds two others on Paris' Champs-Elysees avenue.

Gunman Karim Cheurfi is killed by police and a note praising Daesh is found next to his body, with the group claiming responsibility.

2016

July 26: Two teenagers slit the throat of an 85-year-old priest in front of five worshippers at his church in the western town of Saint-Etienne-du-Rouvray.

Abdel Malik Petitjean and Adel Kermiche, both aged 19, are killed by police. The murder is claimed by Daesh. The teenagers had sworn allegiance to the group in a video.

July 14: A Tunisian ploughs a truck through a large crowd gathered for Bastille Day fireworks on the Promenade des Anglais in the Mediterranean city of Nice. The attack kills 86 people and injures more than 400.

The driver, Mohamed Lahouaiej Bouhlel, 31, is shot dead by security forces. Daesh claims responsibility.

June 13: Larossi Abballa, 25, uses a knife to kill a police officer and his partner at their home in Magnanville, west of Paris, in front of their young son.

Abballa is killed by a police SWAT team, but has already claimed the murders on social media in the name of Daesh.

2015

November 13: France is hit by the worst terror attacks in its history. Daesh militants armed with assault rifles and explosives strike outside a France-Germany football match at the national stadium, Paris cafes, and the Bataclan concert hall in a coordinated assault that leaves 130 people dead and more than 350 wounded.

August 21: Passengers prevent a bloodbath on a high-speed Thalys train from Amsterdam to Paris, tackling a man who opened fire on travellers. He was armed with a Kalashnikov assault rifle, an automatic pistol and a box-cutter. The gunman is identified as 25-year-old Moroccan national Ayoub El Khazzani, known to intelligence services for links to radicals.

June 26: Frenchman Yassin Salhi, 35, kills and beheads his boss and displays the severed head, surrounded by two Daesh flags, on the fence of a gas plant in Saint-Quentin-Fallavier in southeastern France. He tries to blow up the factory, but is arrested. He commits suicide in his jail cell.

April 19: Sid Ahmed Ghlam, an Algerian IT student, is arrested on suspicion of killing a woman who was found shot dead in her car, and of planning an attack on a church in the Paris suburb of Villejuif. Prosecutors say they found documents about Al Qaeda and Daesh at his home, and that he had been in touch with a suspected militant in Syria about an attack on a church.

February 3: A knife-wielding man attacks three soldiers guarding a Jewish community centre in Nice. The 30-year-old assailant, Moussa Coulibaly, is arrested. In custody, he expresses his hatred for France, the police, the military and Jews.

January 7-9: Two men armed with Kalashnikov rifles storm the Paris offices of satirical weekly Charlie Hebdo killing 12 people. A policewoman is killed just outside Paris the following day, while a gunman takes hostages at a Jewish supermarket, four of whom are killed. The attackers are killed in separate shootouts with police, but not before claiming allegiance to Al Qaeda and the Daesh.