The tremor was measured 83 miles (134km) from the port city of Ternate at a depth of 30 miles (45km), according to the US Geological Survey.
Indonesian authorities issued a tsunami alert following the quake, which hit roughly equidistant from the islands of Sulawesi and Halmahera, although they said the risk of dangerous waves reaching land was low.
Strong tremors were felt on Sulawesi, west of the epicentre. Indah Lengkong, who lives in the port city of Bitung, said people had initially panicked.
“The house was visibly shaking,” she added. ”The quake was very strong and lasted for a while. We can still feel tremors but weaker.”
A woman in Tondano, North Sulawesi, tweeted: “The earth was literally shaking so hard.”
Indonesia’s Metro TV said some people had fled to higher ground in North Maluku.
There were no immediate reports of injury or damage, but the Pacific Tsunami Warning Centre said hazardous waves were possible within 186 miles (300km) of the epicentre. It reported no tsunami risk for more distant areas.
Stephen Hicks, a seismologist at Imperial College London, said: “Fortunately, it has occurred offshore and at a reasonably deep depth so risk of damage from shaking and tsunami is low.”