TREBES, France -- A gun-wielding extremist went on a rampage Friday in a quiet corner of southern France, killing three people as he hijacked a car, opened fire on police and took hostages in a supermarket, where panicked shoppers hid in a meat locker or ran through the aisles. After an hours-long standoff, the 25-year-old attacker was killed as elite police forces stormed the market.

They were aided by a heroic police officer who had offered himself up in a hostage swap and suffered life-threatening wounds as a result -- one of 16 people injured in the day's violence.

The Islamic State of Iraq and Syria (ISIS) claimed responsibility for the attack near Carcassonne, a medieval city beloved by tourists, and the town of Trebes. It was the deadliest attack in France since Emmanuel Macron became president last May.

Get Breaking News Delivered to Your Inbox

The officer who volunteered to take the place a female hostage was identified as Col. Arnaud Beltrame. He managed to surreptitiously leave his cellphone on so that police outside could hear what was going on inside the supermarket. Officials said once they heard shots inside the market they decided to storm it.

A police official who was not authorized to be publicly identified confirmed the officer's identity to The Associated Press.

"He saved lives," Macron said.

Macron said investigators will focus on establishing how the gunman, identified by prosecutors as Moroccan-born Redouane Lakdim, got his weapon, and how he became radicalized.

Since January 2015, France has suffered a spate of jihadist attacks that have claimed more than 240 lives in total, according to BBC News. Five people remain in custody after an apparent failed bombing attempt in a chic Paris neighborhood in October, and that same month ISIS claimed a deadly stabbing in Marseille by a man who used multiple aliases. His motives remain unclear, and ISIS has often claimed responsibility for attacks in which it had no direct role.

CBS News correspondent Elizabeth Palmer reported that if, as it appeared, Friday's attack was the work of a lone gunman with little or no help from any coordinated terror cell, it may not prompt a change in France's already heightened security posture.

This undated and unsituated picture obtained on March 23, 2018 shows Radouane Lakdim. HANDOUT/AFP

On Friday night, authorities searched a vehicle and a building in central Carcassonne.

Lakdim was known to police for petty crime and drug-dealing. But he was also under surveillance and since 2014 was on the so-called "Fiche S" list, a government register of individuals suspected of being radicalized but who have yet to perform acts of terrorism.

Despite this, Paris prosecutor Francois Molins there was "no warning sign" that Lakdim would carry out an extremist attack.

A woman close to Lakdim was taken into custody over alleged links with a terrorist enterprise, Molins said. He did not identify her.

President Trump was briefed on the incident, but "Face the Nation" host Margaret Brennan reports that the White House had not yet determined whether it was part of a broader ISIS plot, or the work of a single actor. Once French officials provide the name of the suspect to their U.S. counterparts they will be run through U.S. databases to see if they match any American intelligence files. Brennan said the U.S. government was likely to offer its assistance.

The four-hour drama began at 10:13 a.m. when Lakdim hijacked a car near Carcassonne, killing one person in the car and wounding the other, the prosecutor said.

Lakdim then fired six shots at police officers who were on their way back from jogging near Carcassonne, said Yves Lefebvre, secretary general of SGP Police-FO police union. The police were wearing athletic clothes with police insignia. One officer was hit in the shoulder, but the injury was not serious, Lefebvre said.

Lakdim then went to a Super U supermarket in nearby Trebes, 60 miles southeast of Toulouse, shooting and killing two people in the market and taking an unknown number of hostages. Special police units converged on the scene while authorities blocked roads and urged residents to stay away.

He shouted "Allahu akbar! (God is great)" and said he was a "soldier of the Islamic State" as he entered the Super U, where about 50 people were inside, Molins said.

"We heard an explosion -- well, several explosions," shopper Christian Guibbert told reporters. "I went to see what was happening and I saw a man lying on the floor and another person, very agitated, who had a gun in one hand and a knife in the other."

Guibbert said he led his wife and sister-in-law and nearby customers into the meat locker. Then he went back to see where the assailant was and called police to describe the situation.

"At that moment, he (the gunman) ran after me. Of course I left, I lost him and when I turned around he wasn't there anymore. I took an emergency door and saw the police arrive," Guibbert said.

Another witness, an employee of the supermarket's butcher department identified only by his first name, Jacky, told Europe 1 radio he "heard people shouting and a big 'boom.'"

"It was a gunshot," he said. "Then a second gunshot. After that, my colleagues came toward me saying: 'Come on Jacky, we need to leave! There's someone who's firing shots, he's shouting "Allahu akbar," and he's shot people and he's shooting at everything.'"

He said they left using an emergency exit behind the butcher's stall and they ran across the courtyard.

"We also helped people get out," he said.

During the standoff, Lakdim requested the release of Salah Abdeslam, the sole surviving assailant of the Nov. 13, 2015, attacks in Paris that left 130 people dead. The interior minister suggested, however, that Abdeslam's release wasn't a key motive for the attack.

Abdeslam was recently transported back to Belgium to face charges there. He is believed to have provided key logistical support for the Paris attackers, and either decided not to blow himself up and abandoned his explosive vest, or had it malfunction on him. As CBS News Radio correspondent Elaine Cobbe reports, as the lone surviving suspect in the Paris attacks, Abdeslam has become something of a poster boy for ISIS supporters.

The ISIS-linked Aamaq news agency said the attacker was responding to the group's calls to target countries in the U.S.-led coalition carrying out airstrikes against ISIS militants in Syria and Iraq since 2014. France has been repeatedly targeted because of its participation.

Both Interior Minister Gerard Collomb and Molins praised Beltrame, who Molins said "at the risk of his life took the choice to take the place of the hostages."

The gunman shot Beltrame several times after threatening to blow up the supermarket if police entered, Molins added.

BFM television said Beltrame recently took part in a training exercise simulating a terrorist attack.

As the supermarket standoff reached a crescendo about 2:20 p.m., police heard gunshots inside the building and decided that elite forces had to storm it. Lakdim was killed and two other officers were wounded during the assault, Collomb said.

"He acted alone, there was no one else but him," he added.

Macron rushed back from an EU summit in Brussels to Paris, where counterterrorism investigators took over the investigation. While France hasn't had an attack in several months, "the threat remains high," Macron said, describing ongoing risks from "several individuals who radicalized themselves."

Macron pushed through a tough counterterrorism law last year that gives police extra powers to conduct searches and hold people under house arrest.

In Brussels, German Chancellor Angela Merkel appeared with Macron and said, "When it comes to terrorist threats, we stand by France."

Paris Mayor Anne Hidalgo said the Eiffel Tower would turn its lights off at midnight in tribute to the victims.

At the national stadium outside Paris, 80,000 soccer fans and the national teams of France and Colombia observed a minute of silence Friday night to honor those killed in the attacks earlier in the day. Poignantly, the stadium itself was the site of bloodshed in the deadly Paris attacks in 2015.