A powerful earthquake in Morocco has killed more than 800 people and injured hundreds more, destroying buildings and sending residents of major cities rushing from their homes in the country's deadliest tremor in more than six decades.
The magnitude 7.2 quake struck in Morocco's High Atlas mountains late on Friday night.
The Interior Ministry said 820 people had been killed and another 672 injured, in an updated casualty toll.
A local official said most deaths were in mountain areas that were hard to reach.
In Marrakech, the nearest big city to the epicentre, residents spent the night in the open, afraid to go home.
Buildings in the old city, a UNESCO World Heritage site, suffered damage.
A mosque minaret had fallen in Jemaa al-Fna Square, the heart of Marrakech's old city.
Rescue workers dug through the rubble.
Some 150 people, mostly relatives of the injured, were waiting outside a local hospital.
Most had come from mountainous areas outside the city as their local hospitals lack capacity to treat serious injuries.
The Interior Ministry urged calm, saying in a televised statement the quake had hit the provinces of Al Haouz, Ouarzazate, Marrakech, Azilal, Chichaoua and Taroudant.
Montasir Itri, a resident of the mountain village of Asni near the epicentre, said most houses there were damaged.
"Our neighbours are under the rubble and people are working hard to rescue them using available means in the village," he said.
Morocco's geophysical centre said the quake struck just after 2200 GMT in the Ighil area of the High Atlas.
It was Morocco's deadliest since 1960 when a tremor was estimated to have killed at least 12,000 people, according to the United States Geological Survey.
Ighil, a mountainous area with small farming villages, is about 70km southwest of Marrakech.
Spanish television RTVE reported tremors from the earthquake were felt in Huelva and Jaen in Andalusia, southern Spain.
Governments around the world expressed solidarity and offered assistance.
Turkey, where powerful earthquakes in February killed more than 50,000 people, said it was ready to provide support.
Marrakech is due to host the annual meetings of the International Monetary Fund and World Bank in early October.
In Marrakech, some houses in the tightly packed old city had collapsed and people used their hands to remove debris while they waited for heavy equipment, resident Id Waaziz Hassan said.
Footage of the medieval city wall showed big cracks in one section and parts that had fallen, with rubble lying on the street.
Another Marrakech resident, Brahim Himmi, said he saw ambulances coming out of the old town and many building facades damaged.
He said people were frightened and were staying outside in case of another quake.
People in the capital city of Rabat, about 350km north of Ighil, and in the coastal town of Imsouane, about 180km to its west, also fled their homes, fearing a stronger quake, according to Reuters witnesses.
In Casablanca, some 250km north of Ighil, people who spent the night in the streets were too scared to return to their homes.
"The house rocked aggressively, everyone was scared," resident Mohamed Taqafi said.
Videos shared on social media of the immediate aftermath of the quake, which Reuters could not immediately verify, showed people fearfully running out of a shopping centre, restaurants and apartment buildings and congregating outside.