MEXICO CITY -- A 5.9-magnitude earthquake struck in the Mexican state of Michoacan on Sunday night, causing buildings to sway more than 300 kilometres away in Mexico City.

Some people evacuated buildings in the capital, but there were no immediate reports of damage or injuries. State officials in Michoacan also said they had no reports of casualties or damage.

The U.S. Geological Survey said the quake's epicenter was about 38 kilometres northeast of the Pacific port of Lazaro Cardenas. That is about 327 kilometres west-southwest of Mexico City.

The USGS said its preliminary reading of the quake gave it a magnitude of 5.9. Mexico's National Seismological Service put the magnitude at 5.8.

The tremor occurred 73 kilometres below the Earth's surface, the USGS said. The energy of a deep earthquake dissipates more than that of a shallow quake and generally causes less damage.