It happened on the 100 block of West Ridley Avenue in Ridley Park shortly before 3:30 p.m. Wednesday.
Video shows the flames engulfing all three floors of the home.
Jeff Egee, who lives next door, said the flames were all over the front porch.
"The winds were just feeding the fire, it just got out of hand pretty quickly," Egee said.
Firefighters were on their way as the fire continued to spread.
Two 22-year-old Ridley Park police officers had responded to the scene.
With the flames engulfing the residence, officers Michael Hanly and Jason Golden decided they needed to enter the burning home to evacuate anyone still inside.
Golden worked the first floor, as Hanly went up to the second.
On the second floor, Officer Hanly came upon a man who needed assistance getting out of the home.
"There was an individual, an older gentleman who had some difficulty walking. Michael went into the engulfed fire and was able to get this individual and help him by putting him on his shoulder supporting him and carrying him out of the burning flames. While Officer Jason Golden, his partner, came up the steps to assist him coming down," Ridley Park Police Chief Bobby Frazier said.
From witness accounts, the officers only had seconds to get out.
Officer Hanly was treated and released from a hospital for smoke inhalation.
Four of the five occupants of the apartment also had to be hospitalized for various ailments.
Retired firefighter Jim Cheezum was impressed with the officers' heroic actions.
"They didn't have to do that, but they are above and beyond doing what they're doing, and God bless them," he said.
Chief Frazier said the officers come from first responder families whose relatives are either police or firefighters.
"They did what they were trained to do. They did what they were born to do. They were born police officers. They were born first responders and we're lucky to have these guys here," said Frazier.
Hanly's father, Corporal Mark Hanly, was shot and injured in the line of duty a few years ago, but remains on the Ridley Park police force to this day.
Chief Frazier said he also wants to commend off-duty fire chief John Burns and a passerby, who they are still trying to identify, for their heroic work assisting the two officers.