What Countries Border Morocco? A Complete Guide
limitlessmoroccotours.com
18 September 2026

Morocco sits at the far northwestern corner of Africa, close enough to Europe that you can see Spain from certain spots along its coast. If you have ever looked at a map and wondered what countries border Morocco, the honest answer is shorter than most people expect: just one, by land, in the strict sense. The fuller picture involves a disputed territory to the south, two small Spanish cities sitting on Moroccan soil, and a narrow stretch of water separating Africa from Europe.
This guide walks through Morocco’s actual land borders, its coastline, and the nearby countries that make up its neighborhood, whether by land or by sea.
What Countries Border Morocco and Where Is Morocco Located?
Morocco occupies the northwestern tip of North Africa, in a region known as the Maghreb, meaning “the west” in Arabic. Look at any Morocco map and you’ll notice it has two very different coastlines. The Atlantic Ocean runs along its entire western edge, while the Mediterranean Sea forms the northern border. That combination is unusual. Few countries in the world touch both a major ocean and a major sea at once.
To the east and southeast, Morocco shares its border with Algeria. To the south lies Western Sahara, a territory whose status is still disputed internationally. Just across the water to the north sits Spain, close enough that on a clear day you can make out the Spanish coastline from Tangier.


Countries That Border Morocco
Algeria: The Only Official Land Neighbor
Algeria is Morocco’s sole officially recognized land border, running for well over 1,500 kilometers along the eastern and southeastern edge of the country. This is the relationship that comes up whenever someone asks about Morocco bordering countries, and it’s also the most complicated one.
The border has been closed since 1994, after a bombing in Marrakech led Morocco to introduce visa requirements for Algerian visitors. Algeria responded by shutting the frontier entirely, and more than thirty years later, it’s still closed. Families living on either side have been separated for a generation. Trade between the two countries, which should be simple given how close they are, barely moves through official channels.
You’ll still find the border marked clearly on every Morocco map, guarded and fenced, even though almost nobody legally crosses it anymore. It’s one of the more unusual situations in North Africa: two neighboring countries that share a language and a lot of history, largely cut off from each other.
Western Sahara: A Border in Dispute
South of Morocco lies Western Sahara, a vast, sparsely populated stretch of desert running along the Atlantic coast. Morocco administers roughly four-fifths of this territory and refers to it as its Southern Provinces. The Polisario Front, backed by Algeria, claims independence for the rest under the name Sahrawi Arab Democratic Republic.
Whether Western Sahara counts as a separate country bordering Morocco depends on who you ask, which is part of why it remains such a sensitive topic in North African politics. The United Nations still classifies it as a non-self-governing territory, meaning its final status hasn’t been settled. Morocco, for its part, treats the line as an internal boundary rather than an international one.
Western Sahara itself borders Mauritania to the south. Because of that, Mauritania often gets mentioned among the countries near Morocco, even though the two don’t share a direct, undisputed border of their own.
Spain: A Neighbor on Land and by Sea
Here’s a detail that surprises a lot of people: Morocco actually shares a land border with Spain, not only a maritime one. Two Spanish cities, Ceuta and Melilla, sit right on the Moroccan coast and have belonged to Spain for centuries. Both are fenced off with tall, heavily monitored barriers, and both regularly end up at the center of migration disputes between Rabat and Madrid.
Beyond Ceuta and Melilla, Spain also controls a handful of tiny islands just off the Moroccan coast, including the Chafarinas Islands and the Peñón de Vélez de la Gomera. They’re barely large enough to show up on most maps, but they count as Spanish territory bordering Morocco all the same.
Then there’s the Strait of Gibraltar, the channel separating Morocco from mainland Spain. At its narrowest point, near Tangier, the strait is only around 14 kilometers wide. On a clear day, you really can see Spain from the Moroccan coast, and the other way around too. That closeness is a big reason why Spain, more than any other European country, has such a constant and complicated relationship with Morocco.
Morocco’s Land Borders in Summary
Putting the land situation together: Morocco has one internationally recognized land border, with Algeria to the east. It also borders Western Sahara to the south, though that boundary remains disputed rather than official. On top of that, it shares small land borders with Spain through the enclaves of Ceuta and Melilla.
That’s genuinely the full list of land neighbors. Algeria, by comparison, borders seven separate countries. Morocco’s geography took a different shape: water, not land, does most of the bordering here.
Countries Near Morocco by Sea
Morocco has a long coastline that runs along both the Mediterranean and the Atlantic, well over 1,800 kilometers by most official counts, and considerably more if you include Western Sahara’s stretch of Atlantic coast to the south. Because of that, several of its closest neighbors sit across water rather than behind a fence.
Spain is the obvious one, separated from Morocco by the Strait of Gibraltar to the north. Gibraltar itself, a British Overseas Territory perched at the southern tip of Spain, sits right at the mouth of that strait too.
Further out, the Canary Islands, which belong to Spain, lie just off Morocco’s Atlantic coast, in some spots less than 100 kilometers from Moroccan shores. Portugal sits a bit further north along the same ocean. It’s not close enough to count as a direct neighbor, but it comes up often enough when people search for countries near Morocco that it’s worth a mention.
How Morocco Gets Along with Its Neighbors
Morocco’s relationships with the countries around it are, to put it mildly, uneven.
With Algeria, relations have been cold for decades. Diplomatic ties were formally cut in 2021, largely over the Western Sahara dispute and years of mutual suspicion. Algeria backs the Polisario Front, while Morocco treats the Sahara issue as non-negotiable. Neither side shows much sign of budging, and the closed border has become less of a temporary standoff and more of a fixture of daily life in the region.
With Spain, the relationship runs hot and cold, sometimes within the same year. Trade between the two countries is substantial, and thousands of Moroccans live and work in Spain. Ceuta and Melilla remain a constant sticking point, though. Migration surges at the fences, including a particularly dramatic one in 2021, have strained relations more than once, even as both governments keep cooperating on fishing rights, counterterrorism, and trade.
Mauritania, despite sitting just past Western Sahara, has a comparatively quiet relationship with Morocco. The two countries maintain diplomatic ties and cooperate on regional security without the same level of tension seen with Algeria.
France, while not a bordering country in any geographic sense, still matters a great deal here. Morocco was a French protectorate until 1956, and that history shows up everywhere, from the language taught in schools to the investment still flowing in from Paris.
Why Morocco’s Borders Matter
Understanding Morocco’s borders isn’t just a geography exercise. The closed Algeria border affects everything from fuel prices to the cost of imported goods in eastern Morocco. The situation in Ceuta and Melilla shapes migration policy across the entire Mediterranean. And the unresolved status of Western Sahara continues to influence Morocco’s foreign relations, including how other countries choose to recognize, or decline to recognize, Moroccan sovereignty over the territory.
If you’re planning a trip, doing business, or just trying to make sense of North African politics, knowing exactly which countries border Morocco, and which ones only look close on a map, makes the bigger picture a lot easier to follow.
Frequently Asked Questions
Morocco has one official land border, with Algeria. It also borders Western Sahara to the south, though that territory's status is disputed, and it shares small land borders with Spain through Ceuta and Melilla.
Yes, in two ways. Morocco shares actual land borders with Spain through the cities of Ceuta and Melilla, both located on Moroccan soil. It's also separated from mainland Spain by the Strait of Gibraltar, which is only around 14 kilometers wide at its narrowest point.
Western Sahara's status is still disputed. Morocco administers most of the territory and treats it as part of the country, while the Polisario Front claims independence for it. The United Nations lists it as a non-self-governing territory rather than a recognized country.
The land border has been shut since 1994, after a security dispute led Morocco to introduce visa requirements for Algerian visitors. Algeria closed the border in response, and diplomatic relations between the two countries have stayed tense ever since, including a full break in ties in 2021.
Morocco touches both the Atlantic Ocean, along its entire western coast, and the Mediterranean Sea, along its northern coast. This dual coastline is one of the more distinctive features of Morocco's geography, and Morocco is the only African country with shores on both.
Very close. At the Strait of Gibraltar, Morocco and Spain are separated by only around 14 kilometers of water. On a clear day, you can see the Spanish coast from northern Morocco, and ferries make the crossing from Tangier in under an hour.
Not directly. Western Sahara sits between the two, so Morocco and Mauritania only share a border through that disputed territory, which Morocco partly controls.
Morocco is located in North Africa and is close to several countries. Algeria is Morocco's only land-border neighbor, while Spain is located just across the Strait of Gibraltar. Other countries near Morocco include Portugal and Mauritania, depending on geographic proximity
Among Morocco nearby countries, Algeria shares a land border with Morocco. Spain is connected by a short sea route across the Mediterranean and the Strait of Gibraltar. These neighboring nations play an important role in Morocco's trade, tourism, and regional relations.
Conclusion
So, what countries border Morocco? The short answer is Algeria by land, Western Sahara through a disputed southern boundary, and Spain through both the enclaves of Ceuta and Melilla and the narrow waters of the Strait of Gibraltar. Add in nearby countries like Mauritania and the Canary Islands, and you get a country whose location, wedged between Africa, the Atlantic, and Europe, has shaped its history as much as anything else about it. Next time someone asks what countries border Morocco, you’ll have more than a one-word answer.
- 4-day Casablanca to Marrakech desert tour
- 5-day Morocco tour from Casablanca
- 7-day Sahara desert tour from Casablanca
- 8-day imperial cities tour from Casablanca
- 10-day Morocco tour from Casablanca
- 10-day Imperial cities Tours from Casablanca
- 12-day grand Morocco adventure tour
- 14-day Morocco tour from Casablanca
- 3 Days Tour Marrakech To Merzouga Desert
- 3 Day Marrakech to Fes Desert Tour via Merzouga & Erg Chebbi
- 4 Day Sahara Desert Tour from Marrakech
- 4 Day Marrakech to Fes Desert Tour with Camel Trek & Sahara Experience
- 5-day Marrakech to Fes desert tour
- 6 day Morocco desert tour from Marrakech
- 7-day imperial cities tour Marrakech