The building at 13th and Lindley was missing water pipes, had sewage in the basement, and lacked enough working fire alarms, among other violations.
Judge Mark Bernstein ordered the owners, Lindley Estates LLC of Ripley Street in Philadelphia, to pay the city for transitional housing costs to aid the residents, or make repairs to the building to the city's satisfaction.
Nearly 100 displaced residents are being housed at a South Philadelphia hotel. The remaining tenants have found other housing with family or friends.