The accident occurred with Paris under security lockdown for a ninth consecutive Saturday of "yellow vest" protests, with large parts of the French capital blocked off by riot police.
"As firemen were looking for a gas leak in the building, a dramatic explosion took place," Interior Minister Christophe Castaner said, adding that one of the firemen had been buried under debris for several hours.
Castaner said on his Twitter feed that two firefighters had died, and that 10 people, including one firefighter, had serious injuries. Another 37 people had lighter injuries, he said. Earlier he had told reporters that two civilians had also died.
Just hours after the blast, thousands of yellow vest protesters marched noisily but peacefully through the Grands Boulevards shopping district of northern Paris, just a few hundred meters (yards) from the scene of the explosion.
In recent years, France has suffered a string of deadly Islamist militant attacks in Paris, Nice, Marseille and elsewhere but authorities quickly ruled out foul play.
"A this stage we can say it (the gas blast) is clearly an accident," Paris prosecutor Remi Heitz told reporters.
A police source said the explosion tore apart a bakery on the rue Trevise and witnesses said the force of the blast shattered nearby storefronts and rocked buildings hundreds of meters away.
More than 200 firefighters joined the rescue operation and two helicopters landed on the nearby Place de l'Opera to evacuate victims. Ambulances struggled to access the blast area because of police barriers set up to contain any violence by yellow vest protesters.
An eyewitness at a hotel nearby said he saw flames envelop the ground floor of the building blown out by the blast.
"There was broken glass everywhere, storefronts were blown out and windows were shattered up to the third and fourth floors," said 38-year-old David Bangura.