The losses from the earthquake were painful for residents / Photo: AFP

The historic Moroccan city of Marrakesh suffered extensive damage in a powerful earthquake that has killed at least 1037 people, mostly in rural and hard-to-reach areas.

The 6.8-magnitude earthquake hit late Friday, according to Moroccan authorities.

The epicenter was 75 kilometers (46.6 miles) southeast of Marrakech, striking at a depth of 18.5 kilometers.

The extent of damage to Marrakech, a UNESCO World Heritage site, was not yet clear on Saturday morning though most of the main historic sites in the old city appeared largely unscathed.

Rescuers dig for survivors at village near quake epicentre

Videos on social media captured the immediate aftermath and showed residents spilling out onto the streets.

Images showed residents spending Friday night on the streets.

World leaders have been sending their condolences and messages of solidarity with many describing the disaster as ''terrible.''

Many more are thought to be buried under the rubble of destroyed houses

The situation was said to be particularly dire in Marrakech, where numerous buildings were said to be collapsed and residents trapped under debris.

The earthquake damaged some historic buidings in  city of Marrakesh

The earthquake was the strongest tremor to hit Morocco in the last century, the country’s National Geophysical Institute said.

Tremors were also felt in neighboring Algeria and Mauritania.

some families told journalists that they had lost everything.

The actual extent of the damage could take days or even weeks to become clearer.

TRT Afrika and agencies