Hundreds more were injured when the tremor struck Sulawesi island early on Friday.
A powerful earthquake rocked Indonesia's Sulawesi island Friday, killing at least 42 people, levelling a hospital and severely damaging other buildings, authorities said, as they warned there were people still trapped beneath rubble.
Hundreds were also injured when the 6.2-magnitude quake struck in the early hours, triggering panic among the terrified residents of the island, which was hit by a huge quake and tsunami two and a half years ago that killed thousands.
So far, 34 bodies have been hauled from beneath crumpled buildings in Mamuju, a city of about 110,000 in West Sulawesi province, while another eight were killed south of the area after the quake struck.
"We don't know how many more are missing," said Arianto from the rescue agency in Mamuju, who like many Indonesians goes by one name.
"There are still people trapped beneath the rubble."
Rescuers were searching for more than a dozen patients and staff trapped beneath the rubble of the levelled Mamuju hospital.
"The hospital is flattened - it collapsed," said Arianto.
"There are patients and hospital employees trapped under the rubble and we're now trying to reach them," he added, without giving a specific figure.
Rescuers were also trying to reach a family of eight trapped under the rubble of their destroyed home, he added.
The country's search-and-rescue agency said at least one hotel had partially collapsed after the quake struck at 2:18 am local time Friday, while the regional governor's office also suffered extensive damage.
A Mamuju resident said damage across the city was severe.
"Roads are cracked and many buildings collapsed," said 28-year-old Hendra, who also goes by one name.
"The quake was very strong... I woke up and ran away with my wife."
Responding to the earthquake, Chief of Humanitarian and Resilience Program Save the Children in Indonesia, Dino Satria noted it "will have been a particularly traumatising experience for those children that lived through the devastating quake in Sulawesi in 2018".
"It will be essential that children are prioritised in any response, as they may have witnessed the death of loved ones or become separated from their parents. From our experience in emergencies, we know they will need immediate shelter and be kept safe from harm."
Indonesia experiences frequent seismic and volcanic activity due to its position on the Pacific "Ring of Fire", where tectonic plates collide.
In 2018, a 7.5-magnitude quake and a subsequent tsunami in Palu on Sulawesi left more than 4,300 people dead or missing.
On December 26, 2004, a 9.1-magnitude earthquake struck off the coast of Sumatra and triggered a tsunami that killed 220,000 throughout the region, including around 170,000 in Indonesia.