The quake was centered beneath the Indian Ocean, about 260 miles southwest of the provincial capital of Banda Aceh, according to the U.S. Geological Survey.
Residents said the shaking lasted for about 30 seconds shortly after midnight Wednesday morning.
It was quickly followed by the wail of sirens, warning of the threat of a tsunami.
But the warning was lifted almost two hours after the quake when officials determined that no significant changes in sea level had been created by the temblor.
More than a dozen strong aftershocks jolted the region during the 24 hours following Wednesday morning’s initial quake.
Residents of northwest Sumatra are still deeply traumatized by the massive 2004 earthquake and tsunami disaster that struck on December 26.
Nearly half of the 230,000 victims of that catastrophe across the Indian Ocean basin perished in Aceh.