JOHANNESBURG (Reuters) - An inquiry into a fire that killed 77 people in Johannesburg last year blamed neglect by authorities for allowing a building to become a den for guns, murder, drugs and combustible trash, and failing to evacuate it once it was clear it was a hazard.

South Africa opened the inquiry last October to determine responsibility for the blaze on Aug. 31 last year in the rundown centre of its commercial hub.

The fire cast light on the gangs that seize abandoned public buildings to illegally rent them out. Many victims were so badly burned they had to be identified with DNA testing.

"No case amply demonstrates the consequences of failure to comply with the obligations the law placed on a municipality (than) ... the calamity (of the fire)," the report said.

A spokesperson for the City of Johannesburg did not immediately respond to a request for comment, but in the full report, which Reuters reviewed, the justices said the city "acknowledges that it failed to comply with the applicable laws".

It had said, however, that it should not be held accountable since the building's decline was facilitated by "the illegal conduct of the residents, threats issued ... to its officials and the hijacking of the building".

Johannesburg is one of the world's most unequal cities. Well-to-do leafy suburbs containing houses with private swimming pools lie next to informal settlements where poverty and joblessness are rife.

Panyaza Lesufi, premier for Guateng, the province that includes Johannesburg, promised to swiftly implement the report's recommendations.

"If one thing makes me have sleepless nights, it's the state of ... (central) Johannesburg," he told a news conference.

"It's an indictment on all of us."

The report said the building was regularly the scene of gunshot fire, murders, sex trafficking of teenagers and drug deals. A suspect had confessed to starting the fire to dispose of a murder victim he had killed while high on crystal meth.

It also said firefighters were too slow to respond to emergency calls, while authorities had failed to evacuate and demolish the building, collect the trash accumulating there, or to prevent firefighting equipment being removed for scrap.

(Reporting by Tim Cocks; editing by Barbara Lewis)

By Tim Cocks