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

Maj Gen Tatang Sulaiman, chief of the army in Aceh, said at least 97 died while four people were pulled from the rubble alive. Most of the deaths were in in Pidie Jaya, the district closest to the epicentre.

Another four or five people are still believed to be buried, but it is not known if they are alive.

"Hopefully we would be able to finish the evacuation from the rubble before sunset," said Maj Gen Sulaiman.

The National Disaster Mitigation Agency said 273 people were injured, about a quarter of them seriously.

Some 245 buildings were seriously damaged or destroyed, mostly in Pidie Jaya, including 14 mosques and the remainder largely dwellings and shop houses. Roads also cracked and power poles toppled over.