The quake which struck in Morocco's High Atlas mountains late on Friday night damaged historic buildings in Marrakech – the nearest city to the epicentre – while the most of the fatalities were reported in mountainous areas to the south, Reuters reported.
The Interior Ministry said 1,037 people had been killed and another 672 injured by the quake, gauged by the US Geological Survey at a magnitude of 6.8 with an epicentre some 72 km (45 miles) southwest of Marrakech.
In the village of Amizmiz near the epicentre rescue workers picked through rubble with their bare hands. Fallen masonry filled narrow streets. Outside a hospital, around 10 bodies lay covered in blankets as grieving relatives stood nearby.
The quake, which hit at around 11 p.m. (2200 GMT), affected a sweep of the High Atlas mountain range. Tremors were felt as far away as Huelva and Jaen in Andalusia in southern Spain.
Street camera footage in Marrakech showed the moment the earth began to shake, as men suddenly looked around and jumped up, and others ran for shelter into an alleyway and then fled as dust and debris tumbled around them.
In Marrakech, where 13 people were confirmed dead, residents spent the night in the open, afraid to go home.
In the heart of its old city, a UNESCO World Heritage site, a mosque minaret had fallen in Jemaa al-Fna Square.
Injured people filtered into Marrakech from the surrounding areas seeking treatment.
State television footage from the Moulay Ibrahim area some 40 km (25 miles) south of Marrakech showed dozens of houses collapsed at the foothills of a mountain, and residents digging graves as groups of women stood in the street.
In Marrakech, where rubble had tumbled into the streets, residents described desperate scenes as people fled for safety.
Moroccan state television broadcast images of troops being deployed.
The quake was recorded at a depth of 18.5 km, typically more destructive than deeper quakes of the same magnitude. It was Morocco's deadliest earthquake since 1960 when a quake was estimated to have killed at least 12,000 people, according to the U.S. Geological Survey.
Governments around the world expressed solidarity and offered assistance.
Expressing empathy with the families of the victims, Iranian Foreign Ministry spokesman Nasser Kanaani extended his condolences to the people and the government of Morocco for the death of hundreds of citizens of the country, IRNA reported.
Turkey, where powerful earthquakes in February killed more than 50,000 people, said it was ready to provide support.
Algeria, which broke off ties with Morocco in 2021 over the political status of Western Sahara, said it would open airspace for humanitarian and medical flights.
Marrakech is due to host the annual meetings of the International Monetary Fund and World Bank in early October.