The quake shook parts of southern Japan, including the Amami Islands and areas near Okinawa Main Island, triggering panic among residents as buildings trembled across the region.