Ecuadorian President Guillermo Lasso in a televised event said the earthquake killed 12 people. In a tweet, he also asked people to remain calm.
Risk Management Secretary Cristian Torres in a radio interview said 11 of the victims died in the coastal state of El Oro and one in the highlands state of Azuay.
The victim in Azuay’s Andean community of Cuenca was a passenger in a vehicle crushed by rubble from a house, according to the Risk Management Secretariat, the South American country’s emergency response agency.
In El Oro, the agency also reported that several were trapped under rubble. In the community of Machala, a two-story home collapsed before people could evacuate, a pier gave way and a building’s walls cracked, trapping an unknown number of people.
The agency said firefighters worked to rescue people while the National Police assessed damage, their work made more difficult by downed lines that interrupted telephone and electricity service.
Machala resident Fabricio Cruz said he was in his third-floor apartment when he felt a strong tremor and saw his television hit the ground. He immediately headed out.
“I heard how my neighbors were shouting and there was a lot of noise,” said Cruz, a 34-year-old photographer. He added that when he looked around, he noticed the collapsed roofs of nearby houses.
In Guayaquil, about 170 miles (270 kilometers) southwest of the capital, Quito, authorities reported cracks in buildings and homes, as well as some collapsed walls. Authorities ordered the closure of three vehicular tunnels in Guayaquil, which anchors a metro area of over 3 million people.
Videos shared on social media show people gathered on the streets of Guayaquil and nearby communities. People reported objects falling inside their homes.
One video posted online showed three anchors of a show dart from their studio desk as the set shook. They initially tried to shake it off as a minor quake but soon fled off camera. One anchor indicated the show would go on a commercial break, while another repeated, “My God, my God.”
A report from Ecuador’s Adverse Events Monitoring Directorate ruled out a tsunami threat.
The earthquake was also felt in Peru, from its northern border with Ecuador to the central Pacific coast. No deaths or injuries were immediately reported. In the northern region of Tumbes, the old walls of an Army barracks collapsed, authorities said.
Ecuador is particularly prone to earthquakes. In 2016, a quake centered farther north on the Pacific Coast in a more sparsely populated area of the country killed more than 600 people.
Associated Press writers Regina Garcia Cano in Caracas, Venezuela, and Franklin Briceño in Lima, Peru, contributed to this report.