La vie à Trèbes/From Facebook
Now playing
01:59
French media: Hostage-taker killed by police
French hooded police officers cordon off the area after a knife attack Thursday, Aug. 23, 2018 in Trappes, west of Paris. A man flagged by French authorities as a suspected radical killed his mother and sister and seriously injured another woman in a knife attack Thursday that was quickly claimed by the Islamic State group. (AP Photo/Michel Euler)
Michel Euler/AP
French hooded police officers cordon off the area after a knife attack Thursday, Aug. 23, 2018 in Trappes, west of Paris. A man flagged by French authorities as a suspected radical killed his mother and sister and seriously injured another woman in a knife attack Thursday that was quickly claimed by the Islamic State group. (AP Photo/Michel Euler)
Now playing
00:24
Two dead and one injured in knife attack
AFP/Getty Images
Now playing
02:23
Terror attack rocks Paris ahead of election
Police officers take position outside the Louvre museum in Paris,Friday, Feb. 3, 2017. Paris police say a soldier has opened fire outside the Louvre Museum after he was attacked by someone, and the area is being evacuated. (AP Photo/Thibault Camus)
Thibault Camus/AP
Police officers take position outside the Louvre museum in Paris,Friday, Feb. 3, 2017. Paris police say a soldier has opened fire outside the Louvre Museum after he was attacked by someone, and the area is being evacuated. (AP Photo/Thibault Camus)
Now playing
01:20
Louvre machete attack puts Paris on edge
A picture shows the debris of an explosion after French anti-terrorist police (RAID) raided an apartment, where suspects believed to be involved in plotting an attack were arrested, in an apartment building in Clapiers, near Montpellier, southern France, on February 10, 2017. Four people including a 16-year-old girl were arrested on February 10 by anti-terrorist police in Montpellier on suspicion of preparing an attack, a police source said. The other suspects were aged 20, 26 and 33, according to the source. The four were arrested after buying acetone, a highly flammable liquid that can be used to make bombs. France remains on high alert after a wave of attacks which began two years ago that has claimed more than 200 lives. / AFP / SYLVAIN THOMAS (Photo credit should read SYLVAIN THOMAS/AFP/Getty Images)
SYLVAIN THOMAS/AFP/Getty Images
A picture shows the debris of an explosion after French anti-terrorist police (RAID) raided an apartment, where suspects believed to be involved in plotting an attack were arrested, in an apartment building in Clapiers, near Montpellier, southern France, on February 10, 2017. Four people including a 16-year-old girl were arrested on February 10 by anti-terrorist police in Montpellier on suspicion of preparing an attack, a police source said. The other suspects were aged 20, 26 and 33, according to the source. The four were arrested after buying acetone, a highly flammable liquid that can be used to make bombs. France remains on high alert after a wave of attacks which began two years ago that has claimed more than 200 lives. / AFP / SYLVAIN THOMAS (Photo credit should read SYLVAIN THOMAS/AFP/Getty Images)
Now playing
01:29
France foils 'imminent' terror attack
Police officers stand on guard behind the church of Saint-Etienne-du-Rouvray on July 26, 2016, following an attack by two knife-wielding men.
The Islamic State group said on July 26 that the two assailants who stormed a church in France and killed an elderly priest were its "soldiers,". They stormed the church during morning mass, taking the five people inside hostage and slitting the throat of its priest Jacques Hemel, who was in his eighties. The attackers were killed by police after they emerged from the church when it was surrounded by France's anti-gang brigade, the BRI, which specialises in kidnappings.
 / AFP PHOTO / CHARLY TRIBALLEAUCHARLY TRIBALLEAU/AFP/Getty Images
CHARLY TRIBALLEAU/AFP/AFP/Getty Images
Police officers stand on guard behind the church of Saint-Etienne-du-Rouvray on July 26, 2016, following an attack by two knife-wielding men. The Islamic State group said on July 26 that the two assailants who stormed a church in France and killed an elderly priest were its "soldiers,". They stormed the church during morning mass, taking the five people inside hostage and slitting the throat of its priest Jacques Hemel, who was in his eighties. The attackers were killed by police after they emerged from the church when it was surrounded by France's anti-gang brigade, the BRI, which specialises in kidnappings. / AFP PHOTO / CHARLY TRIBALLEAUCHARLY TRIBALLEAU/AFP/Getty Images
Now playing
07:02
Why is France failing to prevent terror attacks?
french riviera jihadi recruitment pkg_00014217.jpg
french riviera jihadi recruitment pkg_00014217.jpg
Now playing
03:23
Recruitment on the Riviera: France's super jihadi
france terror alert maximum level bittermann lok_00001701.jpg
Getty Images
france terror alert maximum level bittermann lok_00001701.jpg
Now playing
01:29
France terror threat set at maximum level
france terror cell arrest isis bittermann lklv_00002606.jpg
Getty Images
france terror cell arrest isis bittermann lklv_00002606.jpg
Now playing
01:12
France reckons with burgeoning terror threat
france notre dame latest bittermann lok_00000808.jpg
Reuters
france notre dame latest bittermann lok_00000808.jpg
Now playing
01:29
Did terrorists plan to attack the Notre Dame cathedral?
This graphic, featuring suspected ISIS operative Abdel Haddadi, shows his global network.
investigation documents obtained by CNN
This graphic, featuring suspected ISIS operative Abdel Haddadi, shows his global network.
Now playing
01:56
European officials: 30 to 40 ISIS suspects at large
This graphic, featuring suspected ISIS operative Abdel Haddadi, shows his global network.
investigation documents obtained by CNN
This graphic, featuring suspected ISIS operative Abdel Haddadi, shows his global network.
Now playing
08:26
ISIS planned for more operatives during Paris attacks
A woman mourns in front of the house of Father Jacques Hamel on July 27, 2016 in Saint-Etienne-du-Rouvray, where the priest was killed the day before in the latest of a string of attacks against Western targets claimed by or blamed on the Islamic State jihadist group.
CHARLY TRIBALLEAU/AFP/AFP/Getty Images
A woman mourns in front of the house of Father Jacques Hamel on July 27, 2016 in Saint-Etienne-du-Rouvray, where the priest was killed the day before in the latest of a string of attacks against Western targets claimed by or blamed on the Islamic State jihadist group.
Now playing
02:02
Source: French church attacker was under house arrest
hollande we must stand together bfmtv sot_00002426.jpg
BFMTV
hollande we must stand together bfmtv sot_00002426.jpg
Now playing
01:58
Hollande: We must stand together
CNN —  

A French police officer is fighting for his life after shooting a gunman who went on a deadly rampage in southern France, authorities said Friday.

The gunman killed three people and wounded 16 others when he stole a car, fired at police officers and took hostages in a supermarket in what authorities are treating as a terrorist attack.

Arnaud Beltrame in a 2013 photo.
Ouest France/AP
Arnaud Beltrame in a 2013 photo.

Interior Minister Gérard Collomb said the officer, a lieutenant colonel with the National Police, offered to exchange himself for one of the female hostages being held inside the Super U supermarket in Trèbes.

When the officer went inside the supermarket, shots were fired. The lieutenant colonel had his phone on, so police could hear his interactions with the gunman, Collomb said. As soon as they heard gunfire, police went in.

The gunman was killed and the officer, identified by a source close to the investigation as Arnaud Beltrame, was seriously wounded.

The Interior Ministry identified the gunman as 26-year-old Redouane Lakdim, who was known to authorities for minor crimes including drug offenses, Collomb said.

An investigation has been opened into murder and attempted murder “in connection with a terrorist in Trèbes,” the French prosecutor’s office told CNN.

Police have taken into custody a woman who was “very close” to Lakdim and “shared his life,” prosecutor François Molins told reporters at a news conference in Carcassonne.

Police respond to the hostage situation Friday in the southern French town of Trèbes.
Rafik Benbagdad/La Dépêche Du Midi
Police respond to the hostage situation Friday in the southern French town of Trèbes.

“Our country has suffered an Islamist terrorist attack,” President Emmanuel Macron told reporters. “We’ve paid the price of the danger of the terrorist threat in blood for several years.

“I want to state my absolute determination to the nation to lead this fight.”

The ISIS-affiliated Amaq News Agency said that the gunman was a “soldier” of the militant group and that he had responded to its call to attack coalition countries, a reference to the U.S.-led coalition fighting ISIS in Syria and Iraq. Amaq offered no evidence ISIS had any contact with the attacker.

“This attack has been claimed by ISIS, and it is currently being analyzed,” Macron said.

A local prosecutor said the attack appeared to be “ISIS-inspired,” CNN affiliate BFM TV reported. Witnesses said the man shouted, “I am a Daesh soldier,” using another name for ISIS.

A BFM TV reporter at the scene said the attacker claimed to be an ISIS soldier and demanded the release of Salah Abdeslam, the suspected mastermind of the November 2015 Paris attacks.

CNN could not independently confirm the gunman made the demand. Abdeslam is on trial in Belgium.

France has faced a string of terrorist attacks in recent years, including the Paris attacks and other smaller-scale assaults. The country remained under a state of emergency for about two years after the Paris attacks. It was lifted late last year.

How the rampage began

The violence unfolded when the attacker stole a car, killing one person in the vehicle and gravely wounding another, said Collomb, the interior minister.

The gunman then shot at four National Police officers who were jogging in Carcassonne. The driver tried to run the officers down. One of them was wounded, but he is not in serious condition.

The gunman proceeded to the Super U market. He entered the market, firing his weapon and killing two people. He took several others hostage.

Police found the car, and SWAT teams surrounded the market.

Collomb said a National Police lieutenant colonel shot the gunman after offering himself for at least one of the hostages.

The order of the shots was unclear, Collomb said. Police raided the store after hearing gunshots.

Two others were wounded at the market, an Interior Ministry spokesman said.

“People were absolutely calm before and never thought that there could be an attack in a town like this,” Collomb told reporters, adding that the risk of terrorism in France remained “very high.”

A Portuguese citizen was among the wounded, a spokesman for Portugal’s Foreign Ministry told CNN.

Madeline Fuhrman, a witness, said that Carcassonne had gone quiet after the attack.

“It’s totally deserted now. Absolutely every shop is closed. There’s not a soul in sight,” she said.

A supermarket employee who fled as shots were fired told BFM that he and about 50 others had been on lockdown in a car park.

French police and firefighters secure parts of Trèbes on Friday.
Jean-Paul Bonincontro/AP
French police and firefighters secure parts of Trèbes on Friday.

Macron hails heroic actions of officer

Macron, who was in Belgium for a summit of European Union leaders, returned to France and spoke to reporters after a crisis meeting at the Interior Ministry.

French police block access to Trèbes as they respond to the hostage situation Friday.
ERIC CABANIS/AFP/Getty Images
French police block access to Trèbes as they respond to the hostage situation Friday.

The French leader hailed law enforcement’s response.

“The forces of order intervened with remarkable speed, both to contain the individual who hid away with his hostages, to help one of the victims who was still alive who he had left in the surrounding area,” Macron said.

He singled out the officer who volunteered to be traded for a hostage and saluted his bravery.

“He has saved lives, and done his role and his country proud. He is currently fighting for his life, and all our thoughts are with him and his family,” Macron said.

Macron said the investigation should answer several questions – when and how the gunman was radicalized and where he got a weapon.

He said French soldiers overseas risk their lives “to reduce this threat.”

CORRECTION: This story has been updated to correct the spelling of the interior minister’s name and to correct the location of witness Madeline Fuhrman.

CNN’s Simon Cullen, Jim Bittermann and Sebastian Shukla contributed to this report.