JOHANNESBURG: An inquiry opened on Thursday tasked with determining responsibility for a fire in Johannesburg that killed 77 people, throwing a spotlight on gangs that seize abandoned buildings in the city's centre and illegally rent them out.

One of the worst disasters in living memory in South Africa's economic hub, the blaze broke out on Aug. 31 in a dilapidated building crammed with mostly foreign migrants. Many of the victims were burned beyond recognition.

Residents said at the time of the disaster that the building had beentaken over by criminal syndicates who charge fees to occupants, exploiting them but also offering more affordable housing to those who might otherwise be left homeless.

Residents of such buildings also rely on illegal electricity connections, gas burners and - when the country's rolling power blackouts hit - candles, all of which increase the risk of fires.

Johannesburg is one of the world's most unequal cities with widespread poverty, joblessness and a longstanding housing crisis. It has about 15,000 homeless people, according to the government of Gauteng, the province that includes the city.

Johannesburg city authorities had leased the gutted building to a charity providing shelter for women in 2016. But the charity ran out of money and stopped operating, residents said.