Rescuers recover the body of a victim from a collapsed building after an earthquake in Pidie Jaya, Aceh province, Indonesia, Wednesday, Dec. 7, 2016. A strong earthquake rocked Indonesia's Aceh province early on Wednesday, killing a large number of people and sparking a frantic rescue effort in the rubble of dozens of collapsed and damaged buildings. (AP Photo/Heri Juanda)
Rescuers recover the body of a victim from a collapsed building after an earthquake in Pidie Jaya, Aceh province, Indonesia, Wednesday, Dec. 7, 2016. A strong earthquake rocked Indonesia's Aceh province early on Wednesday, killing a large number of people and sparking a frantic rescue effort in the rubble of dozens of collapsed and damaged buildings. (AP Photo/Heri Juanda) Credit: Heri Juanda

MEUREUDU, Indonesia — Thousands of people in the Indonesian province of Aceh took refuge for the night in mosques and temporary shelters after a strong earthquake Wednesday killed nearly 100 people and destroyed dozens of buildings.

Some were homeless after the quake made their houses unsafe and others were too scared to return home. Killer quakes occur regularly in the region, where many live with the terrifying memory of a giant Dec. 26, 2004, earthquake that struck off Sumatra. The magnitude-9.1 quake triggered a devastating tsunami that killed more than 100,000 Acehnese.

Maj. Gen. Tatang Sulaiman, chief of the army in Aceh province, said at least 97 died in the magnitude-6.5 quake that hit before dawn Wednesday, while four people had been pulled from the rubble alive. The Indonesian government declared a two-week emergency period in Aceh and some aid was already reaching hard-hit areas.

TV footage showed rescuers in orange uniforms shining flashlights into the interiors of broken buildings as they searched for signs of life. The pace of the search slowed after night fall, hampered by rain and blackouts.

The U.S. Geological Survey said the earthquake was centered about 19 kilometers (12 miles) southeast of Sigli, a town near the northern tip of Sumatra, at a depth of 17 kilometers (11 miles). The agency had initially placed the epicenter undersea. It did not generate a tsunami.

Siti Rukiah, 51, a mother of four, was among the many people taking refuge in local mosques. She and about 100 other people from Pante Raja, a seaside village in Pidie Jaya district, fled to Nur Abdullah mosque located on higher ground in a nearby hamlet. She said the quake was shallow and felt so powerful she had to grab onto a table to keep from falling down. She was sure a tsunami was coming.

“I’m really scared about a tsunami,” said Rukiah, whose brother and neighbors died in the 2004 disaster. “I don’t want to return home tonight, not only because my house is damaged, but I am still afraid an aftershock could cause a tsunami.”

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.

John Ebel, professor of earth and environmental sciences at Boston College, said there is a risk of aftershocks that even if relatively weak could cause further damage to buildings, particularly because modern building codes aren’t consistently enforced in Indonesia.

In the capital, Jakarta, President Joko “Jokowi” Widodo said he had ordered all government agencies to take part in the rescue efforts for Aceh, a conservative Muslim province that has considerable autonomy from the central government under a peace deal with separatists.

Villager Ahmad Salam said he and his family couldn’t sleep in their house because its roof was damaged and rain was pouring in. The family went to the same mosque they took shelter in after the 2004 disaster.

“Even after 12 years, it feels like yesterday that the tsunami washed away my house,” Salman said.