The earthquake struck at 7:42 am (2242 GMT Friday) eight kilometres (five miles) east-northeast of the city of Miyako at a depth of 44 kilometres, the US Geological Survey said.
The Japan Meteorological Agency measured it at 5.8 and said there was no risk of a tsunami.
Japan is situated at the conjuncture of several tectonic plates and experiences a number of relatively violent quakes every year.
But thanks to strict building codes, even powerful quakes that might wreak havoc in other countries frequently pass without causing much damage.
In May a strong 6.0-magnitude earthquake shook buildings in the capital Tokyo, injuring 17 people.