Residents of Marrakech, the nearest major city to the epicentre, said some buildings had collapsed in the old city, a UNESCO World Heritage site, and local television showed pictures of a fallen mosque minaret with rubble lying on smashed cars.
The local official said most deaths were in mountainous areas that were hard to reach. Morocco's authorities did not immediately release any official statement on deaths or damage.
Pan-Arab al-Arabiya news channel reported that five people were killed from one family, citing unnamed local sources. The local Goud.ma news site reported up to 50 people had died, citing unnamed officials in the earthquake-hit region.
"The earth shook for about 20 seconds. Doors opened and shut by themselves as I rushed downstairs from the second floor," said Hamid Afkir, a teacher in a mountainous area west of the epicentre near Taroudant, adding there had been aftershocks.
Morocco's geophysical centre said the quake struck in the Ighil area of the High Atlas with a magnitude of 7.2. The U.S. Geological Survey put the quake's magnitude at 6.8 and said it was at a relatively shallow depth of 18.5 km (11.5 miles).
Ighil, a mountainous area with small farming villages, is about 70 km (40 miles) southwest of Marrakech. The quake struck just after 11 p.m. (2200 GMT).
In Marrakech, some houses in the tightly packed old city had collapsed and people were working hard by hand to remove debris while they waited for heavy equipment, said resident Id Waaziz Hassan.
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 Rabat, about 350 km (220 miles) north of Ighil, and in the coastal town of Imsouane, about 180 km to its west, also fled their homes, fearing a stronger quake, according to Reuters witnesses.
Some videos shared on social media, which Reuters could not immediately verify, appeared to show at least one building collapsing and rubble in the streets.
Others showed people running out of a shopping centre, restaurants and apartment buildings and congregating outside.
(Reuters)