Maj. Gen. Tatang Sulaiman, chief of the army in Aceh province, said 52 people have died in Pidie Jaya, the district closest to the epicenter. Another two people died in neighboring Bireuen district. The national disaster mitigation agency said 78 people have suffered serious injuries.
The rescue effort involving villagers, soldiers and police is concentrated on Meureudu, a severely affected town in Pidie Jaya district. Excavators were trying to remove debris from shop houses and other buildings where people were believed buried.
Rescuers recover the body of a victim of an earthquake under the rubble of a collapsed building in Pidie Jaya, Aceh province, Indonesia, Wednesday, Dec. 7, 2016. A strong undersea earthquake rocked Indonesia's Aceh province early on Wednesday, killing a number of people and causing dozens of buildings to collapse. (AP Photo/Heri Juanda)
More than 40 buildings including several mosques were flattened in the district located 18 kilometers (11 miles) southwest of the epicenter, according to Aiyub Abbas, the district chief. Roads also cracked and power poles toppled over.
Abbas said there is an urgent need for excavation equipment to move heavy debris and emergency supplies. TV footage showed rescue personnel taking bodies in black bags away from the rubble.
The U.S. Geological Survey said the shallow 6.5-magnitude earthquake that struck at 5:03 a.m. (2203 GMT Tuesday) was centered about 10 kilometers (6 miles) north of Reuleut, a town in northern Aceh, at a depth of 17 kilometers (11 miles). It did not generate a tsunami.
For Acehnese, the quake was another terrifying reminder of their region's vulnerability to natural disasters. More than 100,000 died in Aceh after the Dec. 26, 2004, earthquake triggered a devastating tsunami.
"It was very bad, the tremors felt even stronger than 2004 earthquake," said Musman Aziz, a Meureudu resident. "I was so scared the tsunami was coming."
In the capital Jakarta, President Joko "Jokowi" Widodo said he has ordered all government agencies to take part in the rescue efforts.
Seaside resident Fitri Abidin in Pidie Jaya said she fled with her husband and wailing children to a nearby hill after the quake jolted the family awake early in the morning. They stayed there for several hours until authorities reassured them there was no tsunami risk.
"It terrified me. I was having difficulty breathing or walking," said Abidin.
She said her husband grabbed hold of her and carried her out of the house.
The family's house didn't collapse but the homes of some neighbors did and Abidin is afraid three friends were buried in building collapses.
In Pidie Jaya's neighboring district of Bireuen, a teacher at an Islamic building school died after being hit by falling debris, said health worker Achmad Taufiq.
About 20 people were being treated at a health center and one person was moved to a hospital because of broken bones and a head injury, said Taufiq.
Residents of the nearby town of Lhokseumawe ran out of their houses in panic during the quake and many people fled to higher ground.
The world's largest archipelago, Indonesia is prone to earthquakes due to its location on the Pacific "Ring of Fire," an arc of volcanoes and fault lines in the Pacific Basin. The 2004 quake and tsunami killed a total of 230,000 people in a dozen countries, most of them in Aceh.
Karmini reported from Jakarta, Indonesia. Associated Press journalists Ali Kotarumalos in Jakarta and Ayi Yufridar in Bireuen, Indonesia contributed to this report.
Rescuers use heavy machine to search for survivors under the rubble of a collapsed building after an earthquake in Pidie Jaya, Aceh province, Indonesia, Wednesday, Dec. 7, 2016. A strong undersea earthquake rocked Indonesia's Aceh province early on Wednesday, killing a number of people and causing dozens of buildings to collapse. (AP Photo/Heri Juanda)
Rescuers use heavy machine to search for survivors under the rubble of a collapsed building after an earthquake in Pidie Jaya, Aceh province, Indonesia, Wednesday, Dec. 7, 2016. A strong undersea earthquake rocked Indonesia's Aceh province early on Wednesday, killing at a number of people and causing dozens of buildings to collapse. (AP Photo/Heri Juanda)