There were no immediate reports of any casualties or major damage across Spain's southern coast after a major earthquake of magnitude 6.3 struck about 162 kilometres southeast of Malaga.
The quake hit at 4:22am (local time), the Spanish National Geographic Institute said, and was followed by six lesser aftershocks.
The US Geological Survey had earlier reported the tremor had a magnitude of 6.6 and was registered at 33km deep.
Emergency services in the southern region of Andalucia said in a statement on their Twitter feed they had received 250 calls from alarmed residents.
The tremors and aftershocks were felt throughout the region, including in the cities of Malaga, Cordoba, Seville and Granada.
In Melilla, a Spanish enclave on the Moroccan coast, emergency services said they had received more than 200 calls from people warning of damage to properties. Schools would remain shut on Monday so buildings could be inspected.
Media in Melilla said power was being restored to areas where it had been cut.