An earthquake with a preliminary magnitude of 4.7 hit Kumamoto Prefecture, southwestern Japan, on Saturday, the weather agency said.