A powerful earthquake centered near the southern Mexico resort of Huatulco on Tuesday killed at least five people, swayed buildings in Mexico City and sent thousands fleeing into the streets.