The earthquake struck in the early morning around 160km south east of Malaga and 62km north of the Moroccan city of Al Hoceima, the US Geological Survey (USGS) reports, as cited by AFP.
The quake was followed by a 5.3-magnitude tremor.
Video obtained by RT’s video agency Ruptly, shows that streets in the Spanish enclave of Melilla in Africa were also affected. They were littered with debris following the quake, which struck at 04:20 GMT. Despite being very early in the morning, plenty of people made their way on the streets.
Emergency services could also be seen inspecting the damage caused by the quake. El Mundo reported that 15 people received light injuries and were given medical treatment, though no one needed to be taken to hospital.
Local media in Melilla say that power is being restored after a blackout occurred following the earthquake.
Spanish emergency services in the southern region of Andalusia said they had received around 250 calls from worried residents. Schools have also been closed as a precautionary measure to allow inspectors to check whether any of the buildings have suffered structural damage.
More tremors and aftershocks could be felt throughout the region, including large urban centers such as Malaga, Seville and Cordoba.
Spain was hit by a deadly earthquake in 2011, which killed nine people and left over a hundred injured. That quake only had a magnitude of 5.1, but caught seismologists by surprise due to its shallow depth of only 3km.
Researchers later found that groundwater extraction on a massive scale had caused the quake. According to the study, the loss of water changed the Earth’s crust along the Alhama de Murcia fault line and that disturbance was enough to trigger an ‘elastic rebound’ (a rupture) in the rock, leading to the earthquake.
“Our results imply that anthropogenic activities could influence how and when earthquakes occur,” the report stated.