The 6.8-magnitude quake struck 72 kilometers southwest of tourist hotspot Marrakesh at 11:11 pm, the US Geological Survey reported.
Strong tremors were also felt in the coastal cities of Rabat, Casablanca and Essaouira.
"We felt a very violent tremor, and I realized it was an earthquake," Abdelhak El Amrani, a 33-year-old in Marrakesh, told AFP by telephone.
"I could see buildings moving. We don't necessarily have the reflexes for this type of situation. Then I went outside and there were a lot of people there. People were all in shock and panic. The children were crying and the parents were distraught."
"The power went out for 10 minutes, and so did the (telephone) network, but then it came back on," he added.
"Everyone decided to stay outside."
The quake "killed 632 people in the provinces and municipalities of Al-Haouz, Marrakesh, Ouarzazate, Azilal, Chichaoua and Taroudant", Morocco's interior ministry said in a statement, citing a provisional report.