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