Authorities could not immediately confirm reports that a third person - possibly a civilian the firefighters tried to rescue - was missing in the basement, a police spokesman said.
The fire at the Super Speedy deli was reported just before 4 a.m. The deli is on the ground floor of a corner brick building in a working-class neighborhood on the city's east side. Firefighters were still pouring water on the gutted building hours after the blaze began.
"I've been on 36 years and seen every situation happen. We still do what we have to do," said Fire Chief John McFeely. "It's always very, very tragic. The guys are so close together, but we've got a job to do. In another half an hour, if there's another fire down the street, we'll be there."
Mayor Byron Brown and Fire Commissioner Michael Lombardo were expected to release more information at a midday news conference at the Erie County Medical Center, where the bodies of the two firefighters were taken. The firefighters' names were not immediately released.
There was no immediate information on a possible cause of the fire.
The last Buffalo firefighter killed in the line of duty was 31-year-old Michael Seguin, who died July 4, 1997, when a roof collapsed during a house fire.
The last time more than one Buffalo firefighter died in the line of duty was on Dec. 27, 1983, when five firefighters were killed in a propane tank explosion at a warehouse - the worst loss of life in the department's 129-year history.