· Travel  · 7 min read

Which Countries Border Morocco? A Complete Geographic Guide

Discover which countries border Morocco, from Algeria and Spain to Western Sahara. A detailed geographic guide with border crossing tips for travelers.

Discover which countries border Morocco, from Algeria and Spain to Western Sahara. A detailed geographic guide with border crossing tips for travelers.

Morocco occupies a unique position in North Africa, serving as a bridge between Europe, Africa, and the Arab world. If you are planning a trip, understanding which countries border Morocco helps you envision broader travel itineraries and appreciate the country’s rich cultural crossroads. In this guide, we explore every international land and maritime border Morocco shares, what they mean for travelers, and how to navigate the key crossing points.

Countries That Border Morocco: An Overview

Morocco shares its territory’s edges with two sovereign nations (Algeria and Spain) plus the disputed territory of Western Sahara to the south. In addition, it has extensive maritime borders along the Mediterranean Sea and the Atlantic Ocean. Together, these borders shape Morocco’s identity, trade routes, and tourism landscape.

The country’s land borders stretch for approximately 2,000 kilometers in total. The longest is the eastern boundary with Algeria, followed by the southern frontier with Western Sahara (and by extension Mauritania), and the short northern land borders with the Spanish exclaves of Ceuta and Melilla.

Morocco’s Border with Algeria

The Morocco–Algeria border runs for about 1,559 kilometers, making it by far the longest of Morocco’s land boundaries. It starts at the Mediterranean Sea in the north and extends southeastward through mountainous terrain and vast desert expanses until it reaches the tripoint with Western Sahara.

This border has been officially closed since 1994, following diplomatic tensions between the two North African neighbors. There are no active border crossings open to travelers, and no direct flights connect most Moroccan and Algerian cities. For overlanders dreaming of a seamless Maghreb road trip — connecting Marrakech to Algiers by land — this remains unfortunately impossible.

Historically, the border region includes the rugged High Atlas and Saharan Atlas ranges, and cities like Oujda on the Moroccan side and Tlemcen on the Algerian side once thrived on cross-border trade. Today, the closure profoundly impacts local communities and regional travel logistics.

Traveler tip: If you plan to visit both Morocco and Algeria, you must fly or travel via a third country like Tunisia or Spain. There is no legal land crossing available.

The Northern Border with Spain: Ceuta, Melilla, and the Strait

Spain is the only European country that shares a physical land border with Morocco. This happens at two Spanish enclaves on the North African coast: Ceuta and Melilla. These two autonomous Spanish cities sit on Moroccan soil, surrounded by Moroccan territory and the Mediterranean Sea.

Ceuta is a small peninsula directly across from Gibraltar, with a heavily fortified border fence marking its boundary with Morocco. Thousands of people cross daily for trade and work. Melilla, further east along the coast near Nador, operates similarly — a Spanish exclave with a bustling border crossing at Beni Ansar.

Beyond the enclaves, Morocco and Spain share the Strait of Gibraltar — a narrow waterway that has shaped history for millennia. At its narrowest point, only 14 kilometers separate Punta de Tarifa in Spain from the Moroccan coastline near Tangier. Ferry services connect Tangier, Tangier Med, and other Moroccan ports to Algeciras, Tarifa, Barcelona, and several other Spanish destinations year-round.

The Strait of Gibraltar is not just a maritime border — it is one of the most significant cultural and economic gateways in the world, where the Mediterranean meets the Atlantic and where travelers can step between two continents in under an hour.

Western Sahara and Mauritania: The Southern Frontier

To the south, Morocco borders Western Sahara, a disputed territory that Morocco considers part of its sovereign lands. This border extends for approximately 444 kilometers and connects Morocco proper with the Saharan provinces of Laâyoune-Sakia El Hamra and Dakhla-Oued Ed-Dahab.

Further south, Western Sahara itself borders Mauritania along a 1,561-kilometer frontier. While travelers generally cannot cross freely between Morocco-controlled Western Sahara and Mauritania without proper documentation, the border at Guerguerat near the Atlantic coast is the primary overland route connecting North Africa to sub-Saharan Africa. Adventurous overlanders and rally enthusiasts use this route, though it requires careful planning, paperwork, and awareness of the security situation.

For most tourists, the southern reaches of Morocco represent a gateway to vast desert landscapes, including the Erg Chegaga dunes and the eco-tourism attractions of the Dakhla peninsula, rather than a departure point.

Maritime Borders: Atlantic and Mediterranean Coasts

Morocco’s geography is defined by water as much as land. The country boasts over 1,800 kilometers of coastline, divided between:

  • The Mediterranean coast to the north, stretching from Tangier to the Algerian border near Saidia. This coastline features rugged cliffs, calm bays, and cities like Al Hoceima and Nador.
  • The Atlantic coast to the west, running from Tangier all the way south past Casablanca, Essaouira, Agadir, and into Western Sahara. This vast shoreline offers world-class surfing, fishing ports, and endless sandy beaches.

These maritime borders have profoundly shaped Morocco’s economy — from the bustling port of Tangier Med (one of the largest in Africa) to the sardine fisheries of the Atlantic.

Morocco Border Crossings: Practical Travel Advice

If you are entering or exiting Morocco by land, here are the main morocco border crossings you should know about:

  • Tangier Med / Tanger Ville to Spain: Ferry services operate daily. Passport control and customs happen at the port. Arrive early during peak summer months.
  • Ceuta and Melilla land borders: Open to pedestrians and vehicles. Expect queues, especially during holiday periods. Carry your passport — it will be checked.
  • Guerguerat (Western Sahara – Mauritania): Primarily for overland travelers. A no-man’s-land buffer zone exists. Check the latest travel advisories before attempting this crossing.
  • Airports: For most international travelers, flying into Casablanca, Marrakech, Tangier, or Agadir is the preferred entry method. Morocco has well-connected airports with direct flights to Europe, the Middle East, and North America.

Key tips for border crossings in Morocco:

  • Always carry your passport when traveling near border zones — random checks are common
  • If driving a rental car into Ceuta or Melilla, confirm with your rental agency that cross-border travel is allowed
  • Ferry tickets between Morocco and Spain sell out quickly in summer — book in advance
  • The Algeria border is closed — do not attempt to cross it by any means

Why Morocco’s Borders Matter for Travelers

Understanding which countries border Morocco enriches your travel experience. It explains why Moroccan culture blends Amazigh, Arab, African, and European influences so seamlessly. It helps you plan multi-country itineraries — for example, combining a Morocco tour with a short trip to Spain. And it gives you a deeper appreciation for the diverse landscapes you encounter, from the Mediterranean cliffs of the north to the endless Atlantic beaches and the Saharan dunes of the south.

Morocco’s position at the crossroads of continents makes it one of the most geographically fascinating destinations in the world. Whether you enter by plane, ferry, or overland adventure, the country’s borders tell the story of a land that has connected civilizations for centuries.

If you are looking to experience Morocco’s northern gateway firsthand, consider our 5-Day Tour to Chefchaouen & Imperial Cities from Tangier. Starting in Tangier — the city where the Mediterranean meets the Atlantic and where Spain is visible from the coast — this tour takes you through the blue city of Chefchaouen, the imperial cities of Fes, Meknes, and Rabat, and the ancient Roman ruins of Volubilis.

For a shorter but equally immersive journey, our 4-Day Trip from Tangier to Marrakech connects you from Morocco’s northern gateway to its vibrant heart, passing through Chefchaouen, Fes, and the stunning dunes of Merzouga in the Sahara Desert.

Frequently Asked Questions

Which countries does Morocco share a border with?

Morocco shares land borders with three entities: Algeria to the east, Spain via the enclaves of Ceuta and Melilla to the north, and Western Sahara to the south. It also has maritime borders with Spain across the Strait of Gibraltar.

Is the border between Morocco and Algeria open?

No, the land border between Morocco and Algeria has been closed since 1994 due to political tensions. Travelers cannot cross by land and must fly or take alternative routes.

Can you see Spain from Morocco?

Yes, from Tangier and other points along Morocco's northern coast you can clearly see the Spanish coastline across the Strait of Gibraltar, which is only about 14 kilometers wide at its narrowest point.

Do I need a visa to cross from Morocco to Spain?

If you hold a passport from a visa-exempt country for the Schengen Area, you can cross from Morocco to Spain (Ceuta, Melilla, or mainland Spain) without a visa. Otherwise, a Schengen visa is required.

Back to Blog