More than 100 firefighters responded to the scene on 702 44th Street in Sunset Park just before 5 p.m.
Firefighters had a tough time placing flames under control due to heavy winds.
Authorities say a total of four civilians and 19 firefighters suffered non-life threatening injuries, ranging from burns to sprains to smoke inhalation.
Officials say the fire started on the sixth floor and quickly spread. The roof eventually collapsed, and officials say the building -- housing 54 apartments -- is uninhabitable.
Some residents barely made it out.
"I realized that the building was burning down," said Javier Zuniga, who was in his fourth-floor apartment when the fire started.
Firefighters told him to stay inside, but he could barely breathe. So he made another plan.
"I went through the fire escape," he said. "It was really scary. I've been on my fire escape a few times, but not actually walked down."
Just as firefighters seemed to make progress in one wing of the building, it spread to the other. By nightfall, the fire was still not under control.
The wind forced firefighters to work only from the outside. The fire was finally declared under control at about 6 p.m. Thursday, more than 24 hours after it started.
There is no word yet on the cause of the fire, but authorities do not believe it is suspicious.
Smoke detectors were present and operational, and the apartment's occupants closed the doors upon exiting the building.
The Red Cross reports that more than 50 families made up of about 110 people were displaced, and about 20 families were assisted overnight.
It could be days before residents are allowed back into the building.
* More Brooklyn news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube