A strong earthquake has struck central Mexico, killing more than 200 people and toppling dozens of buildings in the capital, Mexico City.
At least 30 people, mostly children, died after a school collapsed in the capital, local media report.
The 7.1 magnitude quake also caused major damage in neighbouring states.
It struck shortly after many people had taken part in an earthquake drill, exactly 32 years after a quake killed thousands in Mexico City.
The country is prone to earthquakes and earlier this month an 8.1 magnitude tremor in the south left at least 90 people dead.
Though it struck a similar region, Tuesday's earthquake does not appear to be connected with the quake on 7 September, which was at least 30 times more energetic, the BBC's Jonathan Amos writes.
Where was worst hit?
The epicentre of the latest quake was near Atencingo in Puebla state, about 120km (75 miles) from Mexico City, with a depth of 51km, the US Geological Survey says.
The prolonged tremor hit at 13:14 local time (18:14 GMT) on Tuesday and sent thousands of residents into the streets.
An earlier death toll of nearly 250 was lowered to 217 by the country's national co-ordinator for civil protection:
- Morelos state: 71 dead
- Puebla state: 43 dead
- Mexico City: 86 dead
- Mexico state: 12 dead
- Guerrero: 4 dead
- Oaxaca: 1
As many as 37 people - 32 children and five adults - died when the Enrique Rébsamen elementary school collapsed in Mexico City's southern Coapa district, Efe news agency reports, quoting local media.
According to Mexican news site Reforma, 30 bodies have been found at the school and 22 people are missing.
Elsewhere, 15 people were killed when a church near Mexico's Popocatepetl volcano collapsed during Mass, Puebla's governor is quoted by Reuters news agency as saying. The volcano itself had a small eruption as a result of the tremor.
Alfredo del Mazo Maza, governor of the State of Mexico, said schools would be closed on Wednesday. He also ordered all public transport to operate services for free so that people could travel home.
What about survivors?
Emergency workers, aided by military personnel and volunteers, have been working through the night in the search for people trapped under the rubble of collapsed buildings.
At the Enrique Rébsamen school, three people were rescued at about midnight, Reuters reports, adding that one child trapped under the debris was saved after oxygen was supplied through a tube.
At least 209 schools were affected by the quake, 15 of which have suffered severe damage, Mexico's Secretariat of Public Education says.
Buildings at 44 locations collapsed or were badly damaged, Mexico City Mayor Miguel Angel Mancera told TV network Televisa. These are said to include a six-storey block of flats, a supermarket and a factory.
About two million people in the capital were left without electricity and phone lines were down. Officials warned residents not to smoke on the streets as gas mains could have been ruptured.
Some 70% of the electricity supply which went down has now been restored, Mexico's Federal Electricity Commission said.
In a televised address, the president said an emergency had been declared for the affected areas and the military had been drafted in to help with the response.
He also urged residents whose properties were structurally sound to remain in their homes where possible to allow emergency services and those helping with rescue efforts to clear the streets.
Across Mexico City, teams of rescue workers and volunteers clawed through the rubble with picks, shovels and their bare hands.
"My wife is there. I haven't been able to communicate with her," Juan Jesus Garcia, 33, told Reuters, choking back tears next to a collapsed building.
"She is not answering and now they are telling us we have to turn off our mobile phones because there is a gas leak."
Have you been affected by the earthquake? If it is safe to do so you can email your story to email@example.com
Jennifer Swaddle, a teacher at the British International School in Mexico City, told the BBC that part of her classroom had collapsed.
"As we were leaving, the outside of my classroom wall fell, so there was a big pile of rubble. Luckily, fantastically, nobody was hurt, but it was incredibly frightening," she said.
What happened in 1985?
An earthquake drill was being held in Mexico City on Tuesday to mark the 32nd anniversary of a magnitude 8 quake that killed up to 10,000 people and left 30,000 others injured.
The severe tremor caused serious damage to Mexico City and its surrounding areas, with more than 400 buildings collapsed and thousands more damaged.
Correspondents say that residents may have mistaken earthquake alarms for part of the day of drills in the wake of the 1985 quake.
Mexico City is one of the most densely populated cities in the world, with more than 20 million people living in the metropolitan area.
Why is Mexico so prone to earthquakes?
Mexico is one of the most seismically active regions in the world, sitting on top of three of the Earth's largest tectonic plates - the North American, Cocos and Pacific plates.
The latest tremor occurred near the boundary between the North American and Cocos plates, where the latter slides beneath the former.
According to the US Geological Survey, the country has seen 19 earthquakes of at least 6.5 magnitude within 155 miles of the epicentre of Tuesday's quake over the past century.
How has the world reacted?
Foreign leaders sent messages of support to Mexico as the scale of the disaster became clear:
- US President Donald Trump, who has courted controversy with his plans for a border wall with Mexico, tweeted: "God bless the people of Mexico City. We are with you and will be there for you"
- Canadian Prime Minister Justin Trudeau also tweeted his support following the "devastating news"
- Costa Rican President Luis Guillermo Solis, in New York for the UN General Assembly, expressed his "solidarity" with the Mexican people
- Pope Francis said his thoughts and prayers were with the families of those who had lost loved ones in the "devastating" quake. "In this moment of pain I want to express my closeness and my prayer to all of the beloved Mexican population," the pontiff said at the Vatican
The Mexican government earlier issued the following guidance on what to do if a quake strikes in the country:
- stay calm
- find the evacuation route and meeting point
- stay away from windows and objects that may fall
- in case of emergency call 911
- do not use lifts
The UK Foreign Office has said that those travelling to Mexico should follow the advice of the local authorities.