The Morocco–Spain Border: A Complex History of Enclaves and Frontiers
While most national borders are continuous lines dividing two countries, the border between Morocco and Spain is one of the most unique in the world. Rather than a single frontier, it consists of three non-contiguous lines totaling 18.5 kilometers (11.5 miles). These boundaries surround the plazas de soberanía—Spanish sovereign territories located on the North African coast.
Understanding the Plazas de Soberanía
The Morocco–Spain border is defined by three distinct Spanish exclaves (territories separated from the main body of the country). These include:
- Ceuta: A city with a border length of 8 kilometers (5 miles).
- Melilla: A city with a border length of 10.5 kilometers (6.5 miles).
- Peñón de Vélez de la Gomera: A small territory with a border of only 75 meters (80 yards).
In addition to these land borders, Spain maintains control over several islets off the Moroccan coast, such as the Chafarinas and the Alhucemas.

A Timeline of Conquest and Treaties
The history of these territories is rooted in the expansion of Iberian powers into North Africa. Ceuta was the first to be captured, taken by Portugal in 1415. Following the Reconquista—the period during which Christian kingdoms retook the Iberian Peninsula from Muslim rule—Spain began its own expansions. Spain captured Melilla from the Sultanate of Fez in 1497 and took Peñón de Vélez de la Gomera by force in 1508.
The ownership of these territories shifted over the centuries. Peñón de Vélez de la Gomera was retaken by the Kingdom of Fez in 1554 before Spain reconquered it in 1564. Ceuta's status changed during the Iberian Union (1580–1640), when Spain and Portugal were united under one crown. When Portugal regained independence in 1640, Ceuta opted to remain Spanish, a decision formalized by the Treaty of Lisbon in 1668.
The 19th century saw several attempts by Morocco to reclaim these lands. The Hispano–Moroccan War of 1859–60 ended in a Spanish victory, leading to the Treaty of Wad-Ras (also known as the Treaty of Tétouan) in 1860, which expanded Ceuta's limits. Melilla's boundary was more difficult to establish; while an early attempt tried to define the border by the "range of a piece of cannon," this proved impractical. Modern boundary lines for Melilla were eventually settled through treaties in 1861, 1862, and later in 1894–95.
The Protectorate and Independence
In 1912, a treaty between France and Spain established a Spanish protectorate over the Mediterranean littoral of Morocco, known as Spanish Morocco. Ceuta, Melilla, and Peñón de Vélez de la Gomera were absorbed into this entity. When Morocco gained independence from France in 1956, the protectorate was handed over to the new Moroccan kingdom. However, Spain maintained control of the plazas de soberanía, arguing they were Spanish long before the 1912 protectorate was created—a claim Morocco continues to contest.
The Geographic Anomaly of Peñón de Vélez de la Gomera
Peñón de Vélez de la Gomera provides one of the most unusual examples of border formation. Originally an island, a massive storm in 1934 created a tombolo—a sandy spit or ridge that connected the island to the Moroccan mainland. This geological event effectively turned the island into a coastal exclave.
Because no formal treaty was ever signed regarding this new land connection, a straight 75-meter line across the sandy spit has served as the de facto frontier between the two nations.
Modern Security and Migration Challenges
Since Moroccan independence, the sovereignty of these territories has remained a point of tension. In 1975, fears rose that Morocco might attempt an invasion similar to the Green March in Western Sahara. Today, Spain continues to control the territories and does not negotiate their sovereignty.
To manage migration, Spain began constructing border fences in Ceuta and Melilla in 1993, strengthening them in 1995. By 2005, these were upgraded to a doubled-fence system featuring barbed wire and advanced surveillance equipment. These fortifications have been the site of numerous attempted crossings and several fatalities.
Recent years have seen significant volatility. On May 17, 2021, over 6,000 migrants crossed into Ceuta in a sudden influx, which some speculated was a political move by Morocco following Spain's decision to treat Polisario Front leader Brahim Ghali in a hospital. According to the Spanish Interior Ministry, by July 2026, approximately 50,000 migrants had entered Spain through these routes, with 57 deaths reported. Many of these individuals were eventually returned to Morocco.
Maritime Boundaries
Beyond the land borders, Morocco and Spain share maritime boundaries in the Alboran Sea, along the Strait of Gibraltar, and in the area of the Canary Islands. The narrowest point of land between the two nations occurs at the Strait of Gibraltar, where the distance is only 14.3 kilometers (8.9 miles).
Summary of the Morocco–Spain Border
| Territory | Border Length | Key Historical Event | Status |
|---|---|---|---|
| Ceuta | 8 km (5 mi) | Conquered 1415 (Portugal); Spanish since 1640 | Spanish Exclave |
| Melilla | 10.5 km (6.5 mi) | Conquered 1497 (Spain) | Spanish Exclave |
| Peñón de Vélez de la Gomera | 75 m (80 yd) | Became peninsula via tombolo in 1934 | Spanish Exclave |
| Total Land Border | 18.5 km (11.5 mi) | Various treaties (1844–1895) | Non-contiguous |