Social media users captured the odd lights in the sky that have since been the subject of much speculation and scientific debate.
In the video, a strange flash of blue light can be seen near the horizon.
There are several theories about what caused the flashes. One possibility is they were caused by earthquake lights, a phenomenon that has been observed in association with earthquakes.
Earthquake lights are thought to be caused near areas of tectonic stress, seismic activity or volcanic eruptions.
According to the United States Geological Survey, earthquake lights are generated by the shifting tectonic movement. They can appear as steady glows, balls of light, streamers or sheet lightning.
Another possibility is that the lights were caused by lightning. However, earthquake lightning is different from the usual thunderstorm ones by travelling from ground to cloud, activated by electric charges associated with seismic activity within the earth.
The behaviour of electric charges during an earthquake can also explain why some animals exhibit odd behaviour before one.
People can also feel their hair stand up or feel a tingling sensation in their skin because of this.
This is not the first time people have spotted the strange lights before an earthquake which were later proved to be something else.
In 2017 and 2021, when the strongest earthquake in decades hit Mexico City, images and videos showing lights in the sky quickly went viral but later exposed as electric sparks reflected by clouds.
The epicentre of the Morocco earthquake was near the town of Ighil in Al Haouz Province, in the Atlas Mountains, roughly 43 miles south of Marrakech.
This is an unusual area to experience an earthquake, experts say, as previous quakes have taken place further north, closer to a tectonic plate.