There was no tsunami warning or reports of major damage.
Public broadcaster NHK said 17 people were injured. None of the injuries seemed to be life-threatening.
The epicentre of the quake - which struck at 2:06 am (1706 GMT Thursday) - was located 13 kilometres (eight miles) north of the city of Kunisaki, the US Geological Survey said. The quake hit at a depth of 82 kilometres.
Japan's Meteorological Agency said there was no risk of a tsunami but urged residents to stay on alert.
"We fear the danger of rockfalls and landslides has increased" in areas that felt strong tremors, Yohei Hasegawa, director of the agency's earthquake and tsunami observation division, told a news conference.
The quake, which the Japanese agency measured as having a preliminary magnitude of 6.2, registered a strong intensity in parts of southwestern Shikoku, the main island of Honshu and southern Kyushu islands.
There were no abnormalities detected at the Ikata nuclear plant in Ehime prefecture or at the Shimane plant in Shimane prefecture.
More than 18,000 people died when a 9.0-magnitude undersea earthquake sent a towering tsunami barrelling into Japan's northeast coast in March 2011 in the country's worst post-World War II disaster.
Cooling systems at the Fukushima nuclear plant were knocked out, sending reactors into meltdown and forcing tens of thousands of people to flee.