A fire that engulfed a five-storey building taken over for illegal housing killed 73 people including children in central Johannesburg on Thursday, the South African city's emergency services said.
Another 52 were injured in what is on track to become one of the deadliest fires worldwide in recent years.
Bodies were discovered piled up at a security gate that was closed preventing people escaping the blaze, an official said.
City authorities said the building in a deprived crime-ridden area had been turned into illegal housing after being abandoned.
Most of those living there were foreigners, one resident said.
"We have now 73 fatalities and 52 people injured who were transported to various healthcare facilities for further medical care," Emergency Management Services spokesman Robert Mulaudzi said.
At least seven children were among those killed by the flames, the youngest under two years old, he said. Some were left burned beyond recognition.
"I'm grateful to be alive, there was a lot of us running, trying to find the fire exit and a lot of people eventually died because of the smoke inhalation," said Kenny Bupe, a survivor caught up in the blaze while visiting a friend.
The 28-year-old told AFP he was part of a group that managed to break open a locked fire escape gate and run to safety, while others "jumped out" of the windows to save themselves.
Firefighters at the scene have put out the flames and are "busy with damping down", while search and recovery operations are ongoing, Mulaudzi said.
"We are moving floor by floor conducting these body recoveries," he told local broadcaster ENCA.
An AFP reporter at the scene said emergency services were continuing to bring charred bodies out of the building, laying them down under blankets and sheets on the street outside.
"It is indeed a sad day for the city of Johannesburg... over 20 years in the service, I've never come across something like this," Mulaudzi said.
It was not immediately clear what caused the blaze, which broke out overnight.
Mgcini Tshwaku, a member of the city's mayoral committee in charge of public safety, said candles used for lighting inside the structure were a likely cause.
Security gate closed
The building, which has been evacuated, is in what used to be the business district of South Africa's economic hub and was used as an informal settlement, Mulaudzi said, suggesting many may have been squatting there illegally.
"Inside the building itself there was a (security) gate which was closed so people couldn't get out," said Tshwaku.
"Many burned bodies were found stashed at that gate."
Fire trucks and ambulances were parked outside the red and white building with burned-out windows which has been cordoned off by police, as a small crowd of onlookers gathered.
Paramedics assisted survivors, some looking bruised and visibly in pain, as two women on a nearby street consoled each other as they cried.
"The scene this morning was a mess, there were bodies on the ground everywhere," said Noma Mahlalela, 41, a resident, adding most people living at the premises were foreigners.
Authorities estimated more than "80 shacks" were set up inside.
"The fire spread very quickly affecting different levels of the building because of the combustible materials used," said Mulaudzi.
Illegal occupation of disused buildings in Johannesburg's city centre is widespread, with many said to be under the control of criminal syndicates who collect rent from occupants.
South Africa –- the continent's most industrialised economy –- attracts millions of migrants, many undocumented, from other African nations.
The blaze was the deadliest in the country in recent years and one of the worst worldwide.
In December, a fuel tanker blast near Johannesburg killed 34 people, while in June, flames ripped through a dilapidated building in the city and killed two children under 10 who were locked in an apartment.
Speaking outside the premises, Johannesburg mayor Kabelo Gwamanda, sent his condolences to the victims' families describing the incident as a "tragedy".
All survivors are being cared for, regardless of their nationality, authorities said.