The U.S. Geological Survey gave the magnitude as 7.4. The quake collapsed buildings and created a tsunami that washed ashore on southern Japanese islands. At least seven people died, officials said.