The quake hit offshore in the Pacific about 120 kilometers (75 miles) southwest of the town of Tres Picos in far southern Chiapas state, the USGS said.
"Based on all available date ... widespread hazardous tsunami waves are forecast for some coasts," the Pacific Tsunami Warning Center said.
"Tsunami waves reaching more than three meters above the tide level are possible along the coasts of Mexico," it said, with lower waves in other countries.
The tsunami warning was for the coasts of Mexico, down through Central America into Guatemala, El Salvador, Costa Rica, Nicaragua, Panama and Honduras, and as far south as Ecuador.
The quake was felt in Mexico City, where people ran out of buildings after hearing earthquake warning sirens go off.
It was not immediately known if there were casualties.
The quake was also felt in much of Guatemala, which borders Chiapas.
The quake struck at a depth of 33 kilometers (21 miles), the USGS said.