Hi.
Earthquakes are fairly common in the Pyrenees and in southeastern Spain (especially Granada, Almería and Murcia).
Besides, once in a while (about every 200 years or so) there is a very large and catastrophic earthquake with epicenter in the Atlantic Ocean, southwest of the Peninsula, that is felt in the whole Iberian Peninsula. Historically, it has happened in 1755 (15,000 deaths; magnitude 8.5) and 1969 (19 deaths; magnitude 7.3). Other important earthquake happened in 1884 (Granada; 839 deaths).
For a list of the most important earthquakes registered in Spain, see the Spanish
National Geographic Institute list (in spanish).