Rescuers use heavy machine to search for survivors under the rubble in Pidie Jaya, Indonesia.

A strong earthquake rocked Indonesia's Aceh province on Wednesday, killing nearly 100 people and sparking a frantic rescue effort in the rubble of dozens of collapsed and damaged buildings.

Major General Tatang Sulaiman, chief of the army in Aceh province, said at least 97 died while four people were pulled from the rubble alive. Another four or five are known to be buried, but he didn't say if they were dead or alive. The Indonesian government declared a two-week emergency period in Aceh.

The rescue effort involving thousands of search officials, villagers, soldiers and police is concentrated on Meureudu, a severely affected town in Pidie Jaya district near the epicentre. Excavators were trying to remove debris from shop houses and other buildings where people were believed buried. TV footage showed rescuers in orange uniforms shining flashlights into the interiors of broken buildings as they searched for signs of life.

PWPM ACEH/TWITTER Workers rescue a person trapped under the rubble after the 6.5 earthquake in Indonesia.

The province's disaster mitigation agency said more than 600 people were injured. The national disaster agency said some 245 buildings were seriously damaged or destroyed, mostly in Pidie Jaya, including 14 mosques. The rest were mainly dwellings and shop houses. Roads also cracked and power poles toppled over.

READ MORE: Earthquake hits Indonesia, triggering tsunami warnings

The US Geological Survey said the 6.5-magnitude earthquake struck at 5.03am local time (10.03am NZT) and was centred about 19 kilometres southeast of Sigli, a town near the northern tip of Aceh, at a depth of 17 kilometres. The agency had initially placed the epicentre undersea. It did not generate a tsunami.

For Acehnese, the quake was a terrifying reminder of their region's vulnerability to natural disasters. More than 100,000 died in Aceh after a December 26, 2004, earthquake triggered a devastating tsunami.

"It was very bad, the tremors felt even stronger than the 2004 earthquake," said Musman Aziz, a Meureudu resident. "I was so scared the tsunami was coming."

Aiyub Abbas, the chief of Pidie Jaya district, said there was urgent need for emergency supplies and excavation equipment to move heavy debris. Footage showed rescue personnel taking bodies in black bags away from the rubble.

PWPM ACEH/TWITTER A collapsed building.

Muhammad Reza Faisal, director of the general hospital in Pidie Jaya, said the facility was overwhelmed with the numbers of injured and many people were being treated in tents pitched on its grounds. He said five of the quake victims died at the hospital.

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 province that has considerable autonomy from the central government under a peace deal with separatists.

Indonesian Red Cross deployed emergency response teams and advertised bank accounts for donations. Its head of disaster management, Arifin Hadi, said five water trucks have been sent into the quake area. Aid, including hygiene kits, tarpaulins, jerry cans, blankets and family assistance kits, is being distributed, with more to be sent from Jakarta, he said. The International Organisation for Migration said it sent an assessment team to Aceh.

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. 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," Abidin said.

She said her husband grabbed hold of her and carried her out of the house.

BNPB/TWITTER Several people were injured when buildings collapse after Wednesday's earthquake in Indonesia.

The family's house didn't collapse but the homes of some neighbours did and Abidin is afraid three friends were buried in the rubble.

In Pidie Jaya's neighbouring district of Bireuen, a teacher at an Islamic school died after being hit by falling debris, said health worker Achmad Taufiq.

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.