An earthquake with a magnitude of 6.5 shook buildings and caused momentary panic in the Indonesian port city of Padang on Thursday, officials and residents said, but there were no immediate reports