At least 632 killed and 329 injured, according to Moroccan state media.
The quake hit just after 11pm local time (22:00 GMT).
The earthquake’s epicentre was at a depth of 18.5km (11.5 miles) and occurred about 72km (44 miles) northeast of Marrakesh, according to the USGS.
Footage on social media reported to be of the earthquake showed tremors being felt and people running into the streets and buildings shaking.
Internet connectivity disrupted in Marrakesh due to power cuts: Monitor
The connectivity to the Internet was disrupted in Marrakesh due to power cuts in the region after the devastating temblor, according to global internet monitor NetBlocks.
‘We had a horrific night’: Marrakesh resident
Noureddine Bazine, a journalist who is also a Marrakesh resident, said that the earthquake was “sudden and catastrophic” for the residents of the city.
“We lived a horrific night full of nightmares; we are not used to such disasters,” he said, adding that the highest number of deaths were in the region of al-Haouz.
He also said: “In Marrakesh, the highest damage was in the old city, because the buildings are prone to collapse, and some of them can collapse even without an earthquake due to their fragile state.”