But there appeared to be no major damage and no tsunami warning was issued after the earthquake struck late on Saturday.
The epicentre was off the coast of Fukushima prefecture at a depth of 60 km.
The quake struck just weeks before the 10-year anniversary of the March 11, 2011 quake that devastated Japan and triggered a massive tsunami that led to the world's worst nuclear crisis in a quarter of a century.