Arnaud Beltrame, 45,was among a group of officers who rushed to the scene after the attacker, who claimed allegiance to the Islamic State group, stormed the store and fired on shoppers and staff before taking them hostage.
“He volunteered to take the place of the other hostages and has been very seriously wounded,” Macron said in a televised address.
“He saved lives and honoured his colleagues and his country,” Macron said of the officer.
“He is currently fighting for his life and all our thoughts go out to him and his family.”
Beltrame, who is married with no children, had participated as recently as
December in an exercise in Carcassonne on how to respond to a mass shooting at
The gunman, identified as 26-year-old Redouane Lakdim, shot dead two people at the supermarket after earlier opening fire on passengers in a car, killing one of them, and injuring a police officer in nearby Carcassonne.
Speaking at the scene earlier Interior Minister Gerard Collomb said a police team immediately intervened after the start of the siege at around 11 a.m.
They managed to get some of the people out,” he said, but the attacker kept one hostage back as a human shield.
A senior officer, aged 45, then offered to take the hostage's place and remained holed up with Lakdim while negotiations to end the standoff continued.
The officer “left his telephone on the table”, to allow police that had surrounded the building in the sleepy town of 5,000 inhabitants listen in, Collomb said.
“When we heard shots the GIGN (an elite police force) intervened,” the minister said, adding that the policeman was “seriously injured” after being shot by the gunman.
Collomb praised the officer for his “courage” and “act of heroism”.
It is believed he is in a critical condition in hospital.
Other French politicians lined up to praise the bravery of the officer.
“Thanks to this exceptional man for his act of heroism,” said right wing politician Eric Ciotti. “France can be proud of its gendarmes and police.”
Those on Twitter were quick to salute the officer.
All our prayers for the lieutenant-colonel. He is one of the hero of France. I admire his courage. Thanks for your excellent work,” said one.
@Gendarmerie toutes nos prières pour le lt-colonel! il est un héros de la France, j'admire son courage! Merci pour votre excellent travail!
— Papa_Gâteau (@Sugar_Daddy974) March 23, 2018
“Capable to give his life for that of another: respect. There is a word for it: it is heroism. Thank you @Gendarmerie,” said another Twitter user.
A French @Gendarmerie lieutenant colonel took the place of a hostage, knowing he was likely to die.
He is critically wounded. What heroism. Attacker Redouane Lakdim, 26, was shot & killed by police. https://t.co/yX0h6sOq1i
— Noga Tarnopolsky (@NTarnopolsky) March 23, 2018
An officer from the police SWAT team was also hurt in the operation to kill the gunman.
Over the course of his rampage Ladkim killed three people and injured at least three others.
The injured included the driver of the hijacked car as well as a police officer out jogging with colleagues in Carcassonne.