At least 26 people sustained light injuries in the Spanish exclave of Melilla, which lies on the northern coast of Africa, when an unusually strong earthquake struck under the Mediterranean Sea early Monday, the local health authority said.
The 6.3-magnitude earthquake was also felt in the south of Spain, as well as the north of Morocco, according to the earthquake observatory IGN in Madrid and a report by daily El Pais.
According to the US Geological Survey, the quake hit at 0422 GMT, at a depth of 10 kilometres, around 65 kilometres north of the Moroccan coast and 165 kilometres east of Gibraltar.
At least one aftershock reached magnitude 5.3.
People in the south of Spain, Malaga and in holiday resorts along the Costa del Sol were woken by the quakes, but no injuries were reported, according to the regional authorities in Andalusia.
"Our house was swaying as if the walls were made of butter," a local resident in the port city of Malaga told state broadcaster RNE.
There were also no injuries or building damage reported in Morocco, the state news agency MAP said.
Those injured in Melilla were being treated for cuts and bruises, the local health authority said.
Several building were severely damaged, with stones and other building parts falling to the ground. The city parliament had to be closed down after cracks were found in the walls. Schools were to remain closed until they had been properly inspected for damage.
Earthquakes are common in this part of the western Mediterranean. However, quakes with a magnitude of more than 6.0 are rare. The region was last struck by similar quakes in 1994 and 2004, according to IGN.