Rescuers battled through landslides and blocked roads Wednesday to reach survivors from an earthquake in Indonesia's Aceh province that killed at least 24 people, including several children who died when a mosque collapsed.
Almost 250 people were also injured in Aceh's remote, mountainous interior when the strong 6.1-magnitude quake struck the north of Sumatra island on Tuesday, flattening buildings and triggering landslides.
The quake, which struck at a shallow depth of just 10 kilometres (six miles), has sparked panic in the natural disaster-prone region where more than 170,000 people were killed by the quake-triggered tsunami of 2004.
In Blang Mancung village, Central Aceh district, there was widespread devastation with many homes reduced to rubble and at least six children killed when a mosque collapsed during a Koran reading session.
Rescuers dug all night with an excavator through the rubble of the mosque looking for more children but a local disaster agency official said late Wednesday he did not believe that anyone else was buried.
As 16 aftershocks rocked Aceh late Tuesday, around 700 people from the village and its surrounding areas took refuge in makeshift shelters, the national disaster agency said.
Those who remained dug through the rubble of their collapsed houses with bare hands to search for their belongings, an AFP reporter at the scene said.
Bodies of the dead were laid out and covered in blankets at a makeshift emergency health post in the village.
"This is the biggest earthquake we've ever had here," Subhan Sahara, head of the district's disaster agency, told AFP.
"People are still frightened, especially after the aftershocks last night. Nobody dared to stay at home. Everyone slept on the roads or in car parks.
"The earthquake triggered many landslides. People could not get out of the area because of fallen trees and mounds of earth blocking roads."
The main hospital in the district was overwhelmed and tents had been set up outside to treat the flood of patients, he said, adding that food and water were in short supply.
Military, police and local government officials were trying to head to affected areas by ground and in aircraft but some roads were blocked by landslips, the national disaster agency said.
"Bad phone communications, damage to several roads, and landslides are making rescue efforts difficult," said agency spokesman Sutopo Purwo Nugroho.
The agency dispatched a helicopter from neighbouring Riau province to assist in rescue efforts, while an air force plane was also deployed to assess the damage.
"We have recorded 24 people dead and 249 people injured," said Nugroho, adding that 375 buildings had been destroyed or damaged.
The casualties were spread over the two worst-hit districts of Central Aceh and Bener Meriah, he said. Scores of people were being treated at hospitals across the region.
In Bener Meriah, about 300 people camped out overnight in open spaces, such as football fields, as the area was hit by strong aftershocks, Fauzi, an official from the local disaster agency, told AFP.
"There were strong aftershocks last night and people didn't want to go back home, so they stayed in the open overnight, but we don't have enough tents," said the official, who like many Indonesians goes by one name.
"We have a power outage now and communications are unreliable," he added.
People ran outside in the provincial capital Banda Aceh as the quake -- some 320 kilometres (200 miles) away -- shook houses, and in Medan city to the south of the province.
Aceh, on the northern tip of Sumatra, is regularly hit by quakes. The huge quake-triggered tsunami of 2004 not only killed tens of thousands in the province, but also many in countries around the Indian Ocean.
In April last year an 8.6-magnitude quake struck 431 kilometres off Banda Aceh, leaving five dead in the province and prompting an Indian Ocean-wide tsunami alert.
Indonesia sits on the Pacific "Ring of Fire" where tectonic plates collide, causing frequent seismic and volcanic activity.