The Japan Meteorological Agency said the first quake had a magnitude of 5.5 and occurred just off the southern coast of Hokkaido, Japan's northernmost main island, at 2:13 pm.
It said that the quake had a depth of 20 kilometers, and that there was no danger of a tsunami.
A few minutes later, a magnitude-5.7 quake struck just off the coast of the southern island of Okinawa, at a depth of 40 kilometers. There was no threat of a tsunami from that one either.