Heri Juanda, Associated Press
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.

BIREUEN, Indonesia — A strong undersea earthquake rocked Indonesia's Aceh province early on Wednesday, killing at least 25 people and causing dozens of buildings to collapse.

The U.S. Geological Survey said the shallow 6.4-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).

Indonesia's Climate, Meteorology and Geophysics Agency said the quake has no potential to trigger a tsunami.

The chief of the district nearest to the epicenter said 25 people have been killed in that district alone.

Pidie Jaya District chief Aiyub Abbas also said hundreds of people in the district have been injured and more than 40 buildings were flattened. The district is located 18 kilometers (11 miles) southwest of the epicenter.

Abbas said there is an urgent need for excavation equipment to move heavy debris and emergency supplies.

A frantic rescue effort involving dozens of villagers, soldiers and police was underway in Meureudu, a severely affected town in Pidie Jaya. Suyatno, who heads Aceh's search and rescue agency, said three excavators were trying to remove debris from shop houses where three people were believed buried.

In the nearby 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.

In December 2004, a massive earthquake off Sumatra island triggered a tsunami that killed 230,000 people in a dozen countries. More than 160,000 people died in Indonesia alone, and most of those deaths occurred in Aceh.

Karmini reported from Jakarta, Indonesia. Associated Press writer Ali Kotarumalos in Jakarta, Indonesia, contributed to this report.