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