The temblor had a depth of about 20 miles and was centered along the Pacific coast of Oaxaca state near the resort of Huatulco.
The quake was felt in Guatemala and throughout south and central Mexico.
The National Weather Service's (NWS) Pacific Tsunami Warning Center (PTWC) initially said that "hazardous" tsunami waves from the quake were possible within 620 miles of the epicenter, along the Pacific coasts of Mexico, Guatemala, El Salvador and Honduras.
That threat passed about two hours after the initial quake, with the PTWC saying that waves of up to 2.2 feet were recorded in Acapulco and Salina Cruz.
"Minor sea level fluctuations of up to 0.3 meters above and below the normal tide may continue over the next few hours," the agency said.
Guatemala's national disaster agency issued a tsunami alert for its southern Pacific coast forecasting the arrival of waves up to a meter high. It advised people to move away from the sea.
Mexico President Andrés Manuel López Obrador said one person was killed and another injured in a building collapse in Huatulco, Oaxaca. Otherwise he said reports were of minor damage such as broken windows and collapsed walls.
Oaxaca Gov. Alejandro Murat later said a second person was killed in an apparent house collapse in the tiny mountain village of San Juan Ozolotepec.
Ports, airports and refineries were not damaged, he said in a video-recorded phone conversation with his civil defense chief. There had been more than 140 aftershocks, most of them small.
The Mexican Red Cross told Fox News in a statement that volunteers from the organization are continuing to make tours in ambulances to identify possible victims.
"Some roads are blocked due to landslides in the Oaxaca-Istmo highway section," the group said.
Images posted to social media showed damage to some buildings in the Oaxaca state.
In Huatulco, a laid-back beach destination known for surfing and small protected coves, the earthquake knocked goods off shelves and some rubble from buildings.
Mari González of the Princess Mayev hotel in Huatulco told the Associated Press that staff and guests were able to evacuate the building before the quake, but that 45 minutes after the initial quake they were still outside because of strong aftershocks.
“It was strong, very strong,” she said.
González said there was some visible broken glass and mirrors, but no major damage.
Local news media reported damage to some buildings in the state capital, Oaxaca City. State officials said they were assessing any damage.
Video posted to Twitter also showed a sidewalk moving as the earthquake hit the area.
The quake along the coast was felt in central and southern Mexico, swaying buildings in Mexico City and sending thousands into the streets.
Seismic alarms sounded midmorning with enough warning for residents to exit buildings, according to the Associated Press.
Helicopters flew over downtown Mexico City and police patrols sounded their sirens.
Groups of people still milled around in close proximity on streets and sidewalks in some neighborhoods of the capital about an hour after the quake. Many were not wearing masks despite past appeals from municipal officials for them to do so as a way to curb the spread of the new coronavirus.
Video taken nearly 300 miles from the epicenter showed the quake strong enough to create waves in a pool.
The USGS estimated that some 2 million people felt strong or moderate shaking and another 49 million felt weak or light shaking.
Mexico's Pacific coast is located along the volatile "Ring of Fire,” a horseshoe-shaped series of fault lines around the ocean.
The region has most of Earth's subduction zones, where oceanic plates slide under the lighter continental plates.
Earthquakes tend to happen when those plates scrape or subside underneath each other. When that happens at sea, it can spawn tsunamis.
The earthquake hit a quake-prone region of Mexico where four underground tectonic plates come together. In the past 35 years, there have been at least seven magnitude 7 or greater earthquakes, killing around 10,000 people — most of them in a 1985 8.0 quake
Fox News' Vicki Choi and the Associated Press contributed to this report.