Mexico's National Seismological Service put the magnitude at 7.0; the U.S. Geological Survey in Golden, Colo. said it was a 6.4-magnitude temblor. There were no immediate reports of injuries or damage.
The quake was centered about 240 miles west-southwest of Mexico City in the Pacific Ocean and about 30 miles west of the coastal city of Lazaro Cardenas.
It knocked out power in the capital's Colonia Guerrero neighborhood, according to Televisa network.
A magnitude-6 quake can cause severe damage if it is centered under a populated area. Magnitude-7 indicates a major earthquake capable of widespread, heavy damage.
Mexico's worst quakes hit its Pacific coast, where continental plates clash. Among those was the 8.1-magnitude 1985 quake that killed thousands in Mexico City.
Mexico City's construction in a valley on an old lake bed tends to amplify distant quakes. The 1985 quake occurred 200 miles away but set the soil beneath Mexico City shifting like sand. Towns on solid ground closer to the epicenter suffered far less damage.