The Japan Meteorological Agency said the quake struck at 5:08 p.m. local time at a depth of about 25 miles beneath the surface of the Pacific.
No tsunami alert was issued due to the depth and alignment of the quake.
Other than a few broken windows and dislodged ceiling panels, there were no reports of significant damage or injuries attributed to the shaking.
But the quake was felt widely as far away as Tokyo, 175 miles to the southwest, and across the island of Hokkaido to the north.
Japan's early warning system predicted the earthquake just seconds before the seismic wave reached the coast. Public broadcaster NHK interrupted a sumo match to warn residents to take cover.
The quake occurred a day after a separate tremor with an estimated magnitude of 5.7 shook the same region.