Ceuta, Melilla profile
Ceuta and Melilla, fragments of Europe on north Africa's Mediterranean coast, came under Spanish control around 500 years ago.
Madrid says they are integral parts of Spain. On three sides they are surrounded by Morocco, which views the Spanish presence as anachronistic and claims sovereignty.
But improving relations were jeopardised in November 2007 by Spanish King Juan Carlos's first visit to the territories in more than 30 years, which King Mohammed VI strongly condemned.
Spain also controls a scattering of islets along the north African coast, including uninhabited Perejil, which was at the centre of a spat in 2002 when Moroccan soldiers occupied it before being removed by the Spanish army.
More recently, differences over Ceuta and Melilla have not prevented a warming of relations between Morocco and Spain, particularly economic ones. Morocco's premier has advocated "neighbourly" talks on the issue.
With its rebuilt 15th century cathedral, shipyards and a fish-processing plant, Ceuta is viewed by Spain as the more strategically-valuable enclave. The town is a 90-minute ferry ride from mainland Spain.
Melilla, conquered in 1497, is a modern town with a distinctive old quarter.
The territories are surrounded by fences, intended to deter illegal immigrants. But Ceuta and Melilla are nonetheless used by many Africans as stepping-stones to Iberia. Many migrants are caught and some drown while attempting to make the sea crossing. People trafficking is common.
After a series of increasingly-desperate attempts by would-be immigrants to surmount the barriers in 2005, Spain and Morocco agreed to deploy extra troops to try to secure the borders.
Ceuta and Melilla are linked to Spain by ferry services to Malaga, Algeciras and Almeria. Borders and defence are controlled by Madrid. Tourism is an important money-earner with duty-free goods being a big draw for visitors.