There have been no reports of any injuries or damage. Officials said there is also no danger of a tsunami.
Japan is one of the most earthquake-prone countries in the world. In 1995, a quake of magnitude 7.2 killed 6,400 people in the western port city of Kobe.
The Associated Press contributed to this story.