The local hospital was struggling to cope, with the injured being treated on the ground outside the front of the building.

Patients were also being sent to a neighbouring district with greater facilities, said deputy district chief Said Mulyadi.

He said at least seven children were among the dead, and many more had suffered broken bones and other injuries.

"There are many shophouses have caved in, and many (people) are alive but trapped," he said.

Seismologists said the earthquake was felt across much of Aceh province, which was devastated by the 2004 Indian Ocean tsunami. At least five aftershocks followed the quake, said Eridawati, local head of the Meteorology, Climatology and Geophysics Agency.

The US Geological Survey upgraded the magnitude to 6.5 from an initial reading of 6.4 and issued a yellow alert for expected fatalities and damage.

Indonesia experiences frequent seismic and volcanic activity due to its position on the Pacific "Ring of Fire", where tectonic plates collide.

Aceh lies on the northern tip of Sumatra island, which is particularly prone to quakes.

In June, a 6.5-magnitude quake struck off the west of Sumatra, damaging scores of buildings and injuring eight people.

A huge undersea earthquake in the Indian Ocean in 2004 triggered a tsunami that engulfed parts of Aceh.

The tsunami killed more than 170,000 people in Indonesia and tens of thousands more in other countries around the Indian Ocean.