Gunman killed after deadly hostage-taking rampage at French supermarket that 'seems to be a terrorist act' A gunman shot up a supermarket and took hostages in Trebes, France.

Authorities killed a gunman in southern France Friday after his hostage-taking attack on a supermarket left two other people dead as well as a police officer who volunteered to exchange places with a captive, officials said.

A female customer and a male employee died after the assailant opened fire inside the Super U market in the small town of Trebes. More than a dozen others were wounded.

The gunman took hostages and barricaded himself in the supermarket for about two hours as police surrounded the building outside, French Interior Minister Gerard Collomb said at a news conference Friday afternoon.

Authorities eventually entered the market and fatally shot the suspect, identified as 26-year-old Redouane Lakdim, according to Collomb.

The gunman had earlier hijacked a car in the neighboring town of Carcassonne, killing the driver and injuring a passenger. He then shot at a group of police officers who were jogging together, injuring one of them, before driving to the supermarket in Trebes, according to Collomb.

As the hostage-taking situation unfolded, French Prime Minister Edouard Philippe said all information suggests the incident "seems to be a terrorist act."

ISIS later claimed responsibility in a statement via its Amaq News Agency, saying in Arabic that "a soldier of the Islamic State" carried out the attack in Trebes "in response to calls to target the coalition countries."

Officials hailed what they called the heroic actions of an armed police officer who volunteered to take the place of a hostage inside the supermarket.

The 45-year-old officer, identified as Arnaud Beltrame, apparently left his phone line open during the operation so police could monitor the situation from outside. When authorities heard gunshots on the line, they stormed in and killed the gunman, according to Collomb.

After being taken to the hospital in critical condition, the officer was pronounced dead early Saturday, according to a tweet by the minister.

"He saved lives," Macron told reporters.

Suspect Lakdim lived in Carcassonne and was known to local police as a petty criminal and small-time drug dealer, Collomb told reporters. Investigators believe he acted alone in Friday's alleged attack.

Collomb said the gunman, while holding hostages, demanded that authorities release Salah Abdeslam, the only living suspect and the alleged mastermind in the 2015 terror attacks in Paris that left 130 dead.

Investigators are treating Friday's incident as terrorism. The Paris prosecutor's office has opened a terrorism investigation.

"We believe that it is indeed a terror attack," President Macron said earlier at the European Council Summit in Brussels.

ABC News' Dragana Jovanovic and Kirit Radia contributed to this report.