Fire crews were called to the Sterling Apartments at 18th and JFK Boulevard just after 1:30 a.m. where they found a small fire in a trash can inside a 4th floor apartment.
The fire was quickly contained, but triggered the sprinkler system which malfunctioned, preventing firefighters from shutting it off.
Fire officials were forced to evacuate the entire building.
Emergency management teams and repair crews were called in to fix the problem. SEPTA buses were also brought in to provide temporary shelter for the more than 800 people who were forced into the streets overnight.
The bottom floors endured the most water damage including a 7-11convenience store located on the first floor.
The sprinkler system has since been fixed.
All residents have been allowed back into their homes.