Two firefighters involved in rescuing two residents from a burning Kansas City building died after a wall collapsed on them, authorities said.

Fire Chief Paul Berardi said two other firefighters were injured Monday night as the massive fire engulfed the building comprising businesses and apartments on the city's northeast side.

"They did not die in vain," he told KSHB-TV Monday night. "They saved two civilians, carried them out of the second floor on ladders, before the wall collapsed."

All firefighters were accounted for and outside the building when part of the second story caved in, forcing a wall to collapse outwards about nine metres and trapping the four firefighters who had been working to protect a nearby grocery store from the blaze, Berardi said at a news conference Tuesday.

Soon after, two mayday calls indicated firefighters were in "urgent distress," he said. A rapid intervention team witnessed the collapse and pulled them from the rubble. The firefighters were rushed to hospitals, where two were pronounced dead, he said.

Berardi appeared to be fighting back tears as he identified the dead as 17-year department veteran Larry J. Leggio and 13-year veteran John V. Mesh. He didn't provide their ages.

Thoughts and prayers

He said two people were rescued from the building shortly before the collapse but on Tuesday he didn't indicate what role the injured and dead firefighters played in that rescue. He said another person also may have been rescued from inside the structure.

"Our thoughts and prayers are with the families of those lost and injured and with their peers throughout KCFD," he said, adding that "the outpouring of condolences has been amazing."

One of the firefighters was treated and released from a hospital Monday night and the other could be released Tuesday, he said. Fire crews remained at the scene Tuesday morning, but the fire was under control.

Berardi said the cause of the fire did not appear to be suspicious but that a response team from the federal Bureau of Alcohol, Tobacco, Firearms and Explosives would help with the investigation.

Mayor Sly James said he was praying for the firefighters.

"Unfortunately situations like this really bring home to all of us the dangers that firefighters and police officers confront every day."