Firefighters were called to the scene in the city's Jeżyce district shortly before midnight on Saturday following reports of smoke coming from the basement of the building.
As they began investigating, a suspected gas cannister exploded, also injuring three passersby and a resident.
Posting on X, Prime Minister Donald Tusk said: “Two firefighters died today during a firefighting operation in Poznań. Honor their memory!
“They are true heroes of our times. The families of the victims will be surrounded by the state's care.”
The fire quickly engulfed the building, with over 100 residents and neighbors being evacuated as fire crews fought to tackle the blaze from spreading.
Wielkopolska Regional Governor Agata Sobczyk said: “Currently, some of them are with their families, and some in a place secured by the city.
“Later, together with the city authorities, we will develop a broader support model depending on the needs.”
She added that each of the victims of the fire and explosion will receive 6,000 zlotys (€1,400) in emergency support and counseling if needed.”