The quake was registered at a depth of 15 miles, according to the US Geological Survey.
Its epicenter was in the western state of Guerrero, near the seaside resort of Acapulco.
There are no reports of casualties or significant damage, but frightened residents across the Mexican capital fled their homes as the tremor began.
The earthquake was felt in several southern and western Mexican states at 09:27 local time.
Windows were broken and trees fell in Chilpancingo, capital of Guerrero.
In Acapulco, where many tourists were enjoying the Easter holiday, there were scenes of panic.
Mexico lies on top of three continental plates and is regularly shaken by tremors.
uaICm6H-UjsImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…