One family of six was living in a homeless-shelter apartment where a dead rat festered on the floor for two days. Another family had no living-room furniture and had been without electricity for days.

At a different homeless family shelter, a puddle of urine soiled the floor of the only working elevator. And at yet another, one stairway was so treacherously rusted that inspectors ordered guards to block access to it until it was repaired.

All those buildings were part of a system that costs the city Department of Homeless Services about $360 million a year, with the agency sometimes paying well above neighborhood market rates for apartments, according to a city Department of Investigation report released Thursday. It found decrepit and dangerous conditions and lacking enforcement were rife in the city-paid, largely privately-run shelters that house nearly 12,000 homeless families with children.

"At its worst, DHS is turning a blind eye to violations that threaten the lives of shelter residents," the report said, calling for repairs, stiffer inspections and new mechanisms to compel fixes.

The homeless services agency said it had already axed some unacceptable apartments from the system, stepped up inspections and asked for money to hire 19 new inspection staffers, among other steps.

While that's progress, "much work still needs to be done," Department of Investigation Commissioner Mark G. Peters said in a statement.

New York City is legally obligated to provide shelter to all homeless people and has long grappled with how to house them. The problem has grown more acute as the numbers of people seeking shelter rose from an average of about 39,000 a night in the start of 2010 to over 60,000 this past November, according to the most recent data the nonprofit Coalition for the Homeless has gathered from city agencies.

Conditions in some family homeless shelters were bleakly spotlighted in December 2013, when The New York Times profiled an 11-year-old girl who lived amid mice, rotting walls and communal bathrooms in a Brooklyn shelter that no longer houses children. Mayor Bill de Blasio took office the next month and asked for an investigation.

Investigators inspected 25 of the over 140 family shelters last spring and summer. They range from converted hospitals and schools with on-site social services to single-room occupancy hotels and "cluster sites:" apartments within buildings that also house private tenants.

The "cluster sites" proved particularly deplorable, the report said. Inspectors reported roaches crawling on the walls, holes in the corners and unlocked front doors with inadequate security in lobbies of buildings with histories of shootings and other crimes. Garbage was piled in halls, beds were broken and there were rats, including the reeking, dead one that had lingered for two days, the report said.

The city pays an average of $2,450 a month for cluster site apartments, while the average rent in some of their neighborhoods is $1,200 a month and lower, the report said.

But even some better-equipped shelters had fire code violations and other problems, including the rusted-out stairwell, the report said. It was one of two in a 140-family building.

The homeless services agency had known the stairway was deteriorating since 2012 and tried to get money to fix it. Ultimately, the city spent $637,000 for the guards who were ordered after the DOI inspection, plus over $750,000 to fix the stairs. They reopened in September.

___

Reach Jennifer Peltz on Twitter @ jennpeltz.