People in the Maluku capital of Ternate, which was closest to the epicentre, fled from houses and hotels as the earth rumbled.
Jimmy Rimba Rogi, the mayor of Manado, a city on nearby Sulawesi island, said the quake which struck at 00:00 GMT caused panic, but there were no immediate signs of casualties or damage.
He said people along the coast, well prepared for tsunamis, ran inland, before the tsunami warning was later lifted.
In Japan 20 minutes later, another strong quake struck.
Japan’s Meteorological Agency said the magnitude 7 quake hit off the eastern coast of Hokkaido, Japan’s northernmost island at a depth of about 20km.
There were also no immediate reports of injuries or damage but a warning was issued for a 50-cm tsunami along the eastern coast of Hokkaido and the northeastern coast of Japan’s main island of Honshu.
The authorities ordered people to stay away from beaches.