The quake was centred about 162 kilometres southeast of Malaga
Updated 12.00 pm
A strong 6.3-magnitude earthquake has struck the Mediterranean between Morocco and Spain - damaging hundreds of properties and closing schools.
The 20-mile deep quake hit at 5:22am (local time), 39 miles north of the Moroccan city of Al Hoceima and 102 miles east-southeast of Gibraltar, the US Geological Survey said.
It was followed by six aftershocks including a 5.3-magnitude tremor.
There were no immediate reports of any fatalities.
Emergency services received 250 calls from alarmed residents in the Andalucia region, in southern Spain.
Tremors and aftershocks were felt throughout the area including in the cities of Malaga, Cordoba, Seville and Granada.
State TV footage showed people running into the streets in their pyjamas in Melilla, which has a population of 85,000.
Up to 200 households in the Spanish enclave on the Moroccan coast suffered damage to their properties.
Officials said schools would be closed on Monday so buildings could be checked for structural damage.
Power was reportedly being restored in areas hit by blackouts.
Images also showed concrete blocks on the ground which had come crashing down from buildings in the city.
Around 15 people were treated for minor injuries.
Commuters were urged to use their cars only if necessary to avoid creating mass traffic jams.
In its initial assessment of the quake's impact, USGS said there was "a low likelihood of casualties and damage".
In February 2004, a strong 6.3-magnitude earthquake that hit near Al Hoceima killed 631 people.
On Sunday, the US state of Alaska was hit by a magnitude-6.8 earthquake.
YouTube user Elvark captured the exact moment it struck, saying: "Wow! It’s like being on a boat!"
He posted a video of the tremor shaking his home, swinging light fittings and sloshing around the water in fish tanks.
A handful of Kenai households were evacuated after explosions from a natural gas leak destroyed two homes - and a further two caught fire - following the quake.