Geographys
Flag of MoroccoFlag of Spain

Morocco–Spain border

Spain and Morocco share three short land borders, all on Morocco's Mediterranean coast: around the cities of Ceuta and Melilla, and across an 85-metre neck of sand at the Peñón de Vélez de la Gomera. They are the only land borders the European Union has in Africa.

Written from cited sourcesLast checked 25 September 2026Suggest a correction

SPAINMOROCCOCeutaMelillaPeñón de Vélez de la GomeraNador
Today’s borderSpain's three land borders with Morocco, around Ceuta, Melilla and the Peñón de Vélez de la Gomera. At this scale each is only a short line, and the Peñón's 85-metre border is drawn approximately.

Three fortresses on the African coast

Portugal captured Ceuta on 21 August 1415. In 1640, when Portugal broke away from the Spanish Crown, Ceuta did not accept the new Portuguese king and stayed with Spain. Portugal confirmed this in the Treaty of Lisbon in 1668.[6] Castile took Melilla on 17 September 1497, in an expedition led by Pedro de Estopiñán for the Duke of Medina Sidonia.[2]

The Peñón de Vélez de la Gomera is a small Spanish outpost of 1.9 hectares on Morocco's Mediterranean coast. Moroccan forces besieged it in 1680, 1701, 1755, 1781 and 1790.[3] It was an island until 1934, when a storm piled up a sandy isthmus that joined it to the mainland.[3] When Morocco became independent in 1956, the 85-metre line across that neck of sand became an international border.[3]

Spain also holds small islands off the coast, the Peñón de Alhucemas and the Chafarinas Islands.[2] Because they are surrounded by sea, they have no land border with Morocco.

How Ceuta's line was drawn

At first Ceuta held only its small peninsula and the isthmus that joins it to Africa.[2] A peace and trade treaty signed on 28 May 1767 confirmed the limits already set, and stone markers were placed to show them. That marking was put off until 1782.[2] An agreement signed in Tangier on 25 August 1844 put Ceuta's limits back where they had been in 1782, with new markers to be placed under the British consul Drummond Hay as mediator.[2]

Fighting around Ceuta in August 1859 led Spain to declare war on Morocco on 22 October 1859.[2] After a Spanish victory at Wad-Ras on 23 March 1860, the two sides signed a peace treaty in Tetuan on 26 April 1860.[2][4] It enlarged Ceuta's territory to the places best suited to the security of its garrison, and created a neutral strip between the Spanish and Moroccan lines.[2] A joint commission marked out the new border, in Arabic and Spanish, on 17 November 1860.[2] Ceuta's border still follows the limits set by the 1860 treaty.[2]

Melilla and the cannon shots

Melilla's limits were first set by a convention signed on 24 August 1859, which was never ratified because the sultan died days later and war broke out.[2] The peace treaty of 1860 took up its terms, gave Spain the land around the city up to the points best suited to its defence, and provided for a neutral zone beyond it.[2]

The line was fixed in an unusual way. On 14 June 1862 a cannon called "El Caminante", at the Victoria Grande fort, fired 17 shots. Stakes were driven in where the shots landed, and they later became the border markers. This is why Melilla's border has its fan shape.[2] The demarcation was recorded on 26 June 1862.[2]

It was adjusted twice more. In 1891 a new survey redrew the limits, and a convention signed in Marrakesh on 5 March 1894 left the cemetery and mosque of Sidi Guariach outside Melilla, on the Moroccan side.[2] Today the city covers 12.3 km² and its land border is 11.2 km long.[2]

From protectorate to a disputed border

In 1912 France and Spain divided Morocco into protectorates, and Spain took the north. With Spanish administration on both sides, the borders of Ceuta and Melilla mattered much less for four decades.[2] A joint Spanish–Moroccan declaration of 7 April 1956 ended the protectorate and recognised Morocco's independence. Ceuta, Melilla and the rocks stayed Spanish.[2]

Morocco claims all of these territories. On 27 January 1975 it asked the UN decolonisation committee to list Ceuta, Melilla, the Peñón de Vélez, the Peñón de Alhucemas and the Chafarinas as colonies. Spain replied on 12 February that they had been part of Spain since the 15th and 16th centuries, and the committee did not add them to its list.[2] Morocco does not recognise Spanish sovereignty over them, and when it closed the borders in 2020 it did not formally tell Spain.[2]

Europe's border in Africa

Spain joined the European Communities in 1986, and the two cities' borders became external borders of what is now the EU. Ceuta and Melilla are outside the EU customs union. When Spain joined the Schengen area it kept checks on goods and travellers going on from the cities to the rest of Spain, and kept visa-free entry for residents of the neighbouring Moroccan provinces of Tetuan and Nador.[2] Before 2020, about 25 million crossings a year were made at the two cities' borders, including porters carrying large bundles of goods into Morocco.[2]

The first wire fence at Melilla went up in 1971, during a cholera epidemic in Morocco. A double fence of two 3-metre layers followed in 1998, and in 2005 Spain built a triple fence 6 metres high.[2] Ceuta's double fence is about 8 km long and, according to InfoMigrants in 2026, 12 metres high.[1]

Morocco closed both borders on 13 March 2020, citing the coronavirus.[2] In May 2021, during a diplomatic dispute over Spain giving hospital treatment to Brahim Ghali, the leader of the Western Sahara independence movement, Moroccan authorities largely let people pass. About 6,000 people entered Ceuta on 17–18 May, most of them young Moroccans, many of them minors.[7] After Spain's prime minister and Morocco's king agreed a roadmap, the borders reopened on 17 May 2022, first at El Tarajal and Beni Enzar.[5]

On 24 June 2022 about 2,000 people tried to cross into Melilla. At least 23 died. Morocco's national human rights council said they had been crushed in a narrow part of a border post with turnstiles, and had probably suffocated.[8] Legal trade in goods restarted on 15 January 2025, when a lorry crossed at Beni Enzar. Melilla's customs post had been closed since August 2018.[9] The first lorry from Ceuta crossed on 11 February 2025.[10] In late July 2026 tens of thousands of people crossed into Ceuta by land and sea. Al Jazeera reported about 60,000 crossings in 24 hours. By 31 July the Spanish government had confirmed at least 57 deaths, and Prime Minister Pedro Sánchez called the crossings a violation of Spain's territorial sovereignty.[11]

Timeline

  1. 141521 August 1415

    Portugal takes Ceuta

    Portugal captures Ceuta.[6]

  2. 149717 September 1497

    Castile takes Melilla

    An expedition for the Duke of Medina Sidonia takes Melilla.[2]

  3. 1640–68

    Ceuta stays with Spain

    Ceuta sides with Spain when Portugal breaks away, which the Treaty of Lisbon confirms in 1668.[6]

  4. 1782

    Ceuta's limits marked

    Stone markers put Ceuta's limits, confirmed by the 1767 treaty, on the ground.[2]

  5. 185924 August 1859

    Melilla convention

    Spain and Morocco agree Melilla's limits. War breaks out before the convention is ratified.[2]

  6. 186026 April 1860

    Treaty of Wad-Ras

    The peace treaty enlarges Ceuta and Melilla and creates neutral zones. Ceuta's line is marked out on 17 November.[2][4]

  7. 186214 June 1862

    Melilla's cannon shots

    Seventeen shots from the cannon "El Caminante" mark out Melilla's fan-shaped border.[2]

  8. 1934

    The Peñón joins Africa

    A storm builds a sandy isthmus that joins the Peñón de Vélez to the mainland.[3]

  9. 19567 April 1956

    Morocco independent

    The protectorate ends and the three land borders become international borders.[2][3]

  10. 197527 January 1975

    Morocco's claim at the UN

    Morocco asks the UN decolonisation committee to list Ceuta, Melilla and the rocks. Spain rejects the request.[2]

  11. 2005

    Six-metre fences

    Spain raises the Melilla fence to six metres and makes it a triple fence.[2]

  12. 2020–22

    Borders closed

    Morocco closes the borders on 13 March 2020. They reopen on 17 May 2022.[2][5]

  13. 202117–18 May 2021

    Ceuta crossings

    About 6,000 people enter Ceuta during a diplomatic dispute.[7]

  14. 202224 June 2022

    Deaths at Melilla

    At least 23 people die in a crush at a border post.[8]

  15. 2025

    Customs posts open

    Lorries carry goods legally across the land borders, from Melilla on 15 January and from Ceuta on 11 February.[9][10]

  16. 2026July 2026

    Mass crossing at Ceuta

    Tens of thousands cross into Ceuta and at least 57 people die.[11]

Sources

  1. [1]
    In Ceuta, ‘every day, migrants try to enter’ the Spanish enclave · Leslie Carretero, InfoMigrants · 20 March 2026
  2. [2]
    Ceuta y Melilla, frontera terrestre de España y de la Unión Europea en África · Observatorio de Ceuta y Melilla, Instituto de Seguridad y Cultura (R. Bermejo García, A. Sierras Sánchez, E. Ávila Pérez) · 3 December 2020

    In Spanish. Treaty history of both borders, the 1975 UN request, the 2020 closure, and the Melilla fence and crossings as described by the Guardia Civil's Melilla commander. The report argues Spain's side of the dispute; only its factual history is used here.

  3. [3]
    The World’s Shortest Border · Martin W. Lewis, GeoCurrents · 30 August 2010

    The Peñón de Vélez de la Gomera: its size, sieges, the 1934 isthmus and the 85-metre border.

  4. [4]
    El Tratado de Wad-Ras de 1860 y la soberanía española sobre Ceuta y Melilla · Maldita.es · 28 August 2026

    In Spanish. The treaty's date, 26 April 1860, and that it enlarged both cities.

  5. [5]
    Government of Spain to reopen land borders with Morocco on 17 May · La Moncloa (Government of Spain) · 12 May 2022
  6. [6]
    Ceuta · Maria Dávila, Encyclopaedia of Portuguese Expansion (NOVA FCSH) · 2009
  7. [7]
  8. [8]
  9. [9]
  10. [10]
  11. [11]

Map geometry from Natural Earth via world-atlas. See credits.