A senior officer then offered to take the hostage's place and remained holed up with Lakdim while negotiations to end the standoff continued.
The attacker, named as Redouane Lakdim, 25, was born in Morocco and lived in Carcassonne.
Macron said a total of 16 people had been injured in the attacks in Carcassonne and Trebes.
"Collomb said Lakdim in the standoff requested the release of the sole surviving assailant of November 13, 2015, attacks in Paris that left 130 people dead", the AP reports.
The country's Prime Minister Édouard Philippe has revealed that the incident is being investigated as a terrorist attack.
The suspect, identified as 26-year-old Redouane Lakdim, shot dead two people at the supermarket after earlier opening fire on passengers in a auto, killing one of them, and injuring a police officer in nearby Carcassonne.
The man first shot at four police officers in the historic town of Carcassonne before barricading himself in the Super-U supermarket in Trebes, about 8 km to the east.
Lakdim, a drug dealer monitored as a possible Islamist extremist, carried out three separate shootings in the medieval town of Carcassonne and in nearby Trebes where he ended his rampage by taking hostages at a supermarket.
Hundreds of police officers were deployed to the area which was cordoned off. Witnesses said the man shouted, "I am a Daesh soldier", using another name for ISIS. "I saw a cold room door, I asked people to come and take shelter", she told Franceinfo radio.
"We were 10, and we stayed an hour".
A lieutenant-colonel swapped himself in exchange for one of the hostages, Collomb said, adding that the 45-year-old had been seriously wounded.
When police heard gunshots on the phone line, an elite Swat team stormed the supermarket. The gunman was killed but Lt-Col Beltrame was injured.
Mr Collomb said two other officers were wounded during the assault. The officers were returning from jogging and were wearing athletic clothing with police insignia, the AP reports. Let us know your opinion below!
In particular, French Interior Minister Gerard Collomb revealed that Lakdim had previously been arrested for dealing drugs. He was known to police, but hadn't shown signs he was ready to commit any sort of attack, according to the prosecutor.
"He is now fighting for his life and all our thoughts go out to him and his family". Salafism is a strict, hard-line branch of Sunni Islam that has often been blamed for "radicalizing" Muslim youth in Europe and North America.
Portuguese President Marcelo Rebelo de Sousa expressed his condolences to the family and friends of the victim in a statement published late Friday on the presidency website.
What has the reaction been?
The jihadist group claimed responsibility for the attack through its propaganda mouthpiece, Amaq.
The attack was carried out by "a foreigner on the "S" list who was also a delinquent", the party noted.
Counter-terrorism prosecutors are leading the investigation.
France has been hit with several deadly jihadist attacks since 2015 and has been on high alert since.
A state of emergency put in place just after the 2015 Paris attacks was lifted last October when Macron's centrist government passed a new law boosting the powers of security forces. But he is, in fact, a French citizen.
France is part of a United States-led coalition fighting against Islamic State in Syria and Iraq and also has thousands of soldiers in West Africa fighting al Qaeda-linked militants.