Fourteen kilometres apart at their closest point, Spain and Morocco have long maintained a relationship shaped by geographic proximity, historical mistrust and periodic crises. Yet beneath territorial, migration and diplomatic disputes, a much deeper interdependence has gradually emerged. Trade, industry, ports, energy, security, migration and infrastructure now connect both sides of the Strait of Gibraltar. Madrid and Rabat are no longer simply neighbours: they are increasingly becoming two components of the same strategic space between Europe, the Mediterranean and Africa.

A map is enough to understand the fundamentals. Spain forms the southwestern edge of continental Europe. Morocco occupies the northwestern corner of Africa. Between them, the Strait of Gibraltar connects the Mediterranean to the Atlantic and concentrates a major share of global maritime traffic.

Yet proximity has never produced a simple relationship. Spain’s colonial history in Morocco, the Rif War, decolonisation, Western Sahara, Ceuta and Melilla, maritime boundaries, fisheries and migration have repeatedly generated tensions.

But a quieter transformation has taken place over recent decades: the material interests of the two countries have become sufficiently intertwined to make crises increasingly costly.

The Spanish-Moroccan relationship has therefore gradually moved from difficult coexistence towards strategic interdependence.

A History That Still Matters

Spain once maintained an extensive territorial presence in northern and southern Morocco. The Spanish protectorate established in 1912 covered parts of the Rif, while Madrid also controlled territories farther south.

The Rif War, fought between 1921 and 1926, remains one of the most violent episodes of this history. Following Moroccan independence in 1956, most Spanish possessions were gradually relinquished, but several territorial questions remained unresolved.

Ceuta and Melilla constitute the most visible dispute. The two cities, administered by Spain for centuries, are considered by Madrid to be integral parts of Spanish territory. Morocco disputes this situation and regards the two enclaves as territories that should ultimately return to Moroccan sovereignty.

Several smaller Spanish-controlled islands and territories off the Moroccan coast add another layer to the dispute.

In 2002, disagreement over Perejil Island — Leila in Morocco — even produced a limited military confrontation. Moroccan soldiers occupied the uninhabited islet before a Spanish military operation removed them. US mediation eventually helped restore the status quo.

The episode illustrated a persistent characteristic of the bilateral relationship: seemingly minor territorial disputes can acquire enormous symbolic importance because they touch on much broader questions of sovereignty, history and regional status.

Western Sahara, the Diplomatic Pivot

For decades, Western Sahara represented one of the principal obstacles to a permanently stable relationship.

A Spanish colony until 1975, the territory is now largely controlled by Morocco, while the Polisario Front claims independence. The United Nations continues to classify Western Sahara as a Non-Self-Governing Territory whose final status remains unresolved.

In March 2022, the Spanish government significantly changed its diplomatic position. Pedro Sánchez stated that Madrid regarded Morocco’s 2007 autonomy proposal as “the most serious, credible and realistic basis” for resolving the dispute, while maintaining that a solution should take place within the United Nations framework and be mutually acceptable to the parties.

The shift helped bring a major diplomatic crisis between Madrid and Rabat to an end.

In May 2021, several thousand people had crossed into Ceuta from Morocco within a short period amid severe tensions following Spain’s decision to provide medical treatment to Polisario Front leader Brahim Ghali.

The episode demonstrated forcefully to Madrid that diplomatic, migration and security issues could not easily be separated.

The rapprochement initiated in 2022 has since endured. At the 13th Spain-Morocco High-Level Meeting held in Madrid in December 2025, both governments explicitly reaffirmed their commitment to continuing the roadmap launched in 2022. Fourteen additional cooperation agreements were signed.

The Western Sahara issue has nevertheless not disappeared from the European legal and diplomatic landscape. In October 2024, the Court of Justice of the European Union issued several judgments concerning the application to Western Sahara of agreements concluded between the European Union and Morocco. The Court reaffirmed the territory’s separate status under EU law and addressed the requirement for the consent of the people of Western Sahara.

Political normalisation between Madrid and Rabat therefore does not eliminate the legal and diplomatic complexities surrounding the territory.

A Trade Relationship That Has Become Structural

The deepest transformation may be economic.

Spain became Morocco’s leading trading partner in 2012 and has maintained that position since, according to the Spanish government. In 2024, Spanish exports to Morocco reached €12.859 billion, while Spanish imports of Moroccan goods amounted to €9.834 billion.

Outside the European Union, Morocco was Spain’s third-largest export destination that year, behind the United States and the United Kingdom, and its fourth-largest supplier.

These figures represent more than simply expanding bilateral trade.

A growing share of the relationship is embedded in integrated value chains. Automotive manufacturing, electrical equipment, textiles, agriculture, industrial components, logistics and services connect companies operating on both sides of the Strait.

Morocco is therefore no longer merely an export market for Spain. It is increasingly an industrial platform immediately south of the European Union.

For Spanish companies, the configuration is particularly attractive: geographic proximity, different production costs, Morocco’s trade agreements with multiple regions and rapidly expanding infrastructure.

For Morocco, Spain simultaneously represents a market, investor, industrial supplier and gateway to the European economy.

It is precisely this reciprocity that is changing the nature of the relationship.

Tanger Med and Algeciras: Two Shores of the Same System

Nowhere is this interdependence more visible than in the Strait.

On the European shore lies the Port of Algeciras complex. On the African shore, Tanger Med has become one of the leading port and logistics hubs in both the Mediterranean and Africa.

At first glance, the two ports may appear to be competitors seeking to capture the same container and transshipment traffic.

In reality, they also belong to the same maritime ecosystem.

Only a few dozen kilometres separate their terminals. Ferries, trucks, containers, industrial supply chains and people move constantly between the two shores.

The Strait is therefore increasingly functioning as an integrated economic interface between two continents.

This geography could become even more important as companies seek to position parts of their production closer to European markets. In a world where businesses are attempting to reduce certain Asian dependencies and shorten supply chains, northern Morocco possesses an exceptional geographic advantage.

Andalusia and northern Morocco could consequently be understood less as peripheral regions belonging to separate continents than as the two shores of a single economic corridor.

The Automotive Industry as a Laboratory for Integration

The automotive sector illustrates this transformation particularly well.

Since the 2010s, Morocco has developed a major automotive manufacturing industry centred particularly around Tangier and Kenitra. A network of suppliers has emerged around large manufacturers, producing wiring systems, components, electronics and mechanical parts.

Spain, meanwhile, possesses one of Europe’s largest automotive industries.

Geographic proximity therefore enables the development of trans-Mediterranean production chains in which components can cross the Strait at different stages of manufacturing.

This dynamic could expand considerably.

Batteries, electric mobility, aerospace, electronics, railway equipment, renewable energy and water-related industries are among the sectors where significant complementarities could emerge.

During the December 2025 bilateral meeting, Madrid and Rabat specifically emphasised greater integration of their economies into Mediterranean and African regional value chains. Spain also highlighted the interest of its companies in Morocco’s railway, port, airport and road investment programmes.

The relationship is therefore beginning to move beyond the exchange of goods towards the organisation of the production systems themselves.

Migration: Cooperation and Vulnerability

Migration nevertheless remains one of the most sensitive issues.

Morocco is simultaneously a country of origin, transit and destination for migration. Its geographic position makes it one of the principal interfaces between Africa and Western Europe.

For Spain, cooperation with Moroccan authorities is therefore crucial to managing western migration routes towards the Iberian Peninsula, Ceuta, Melilla and the Canary Islands.

But this cooperation also creates dependency.

The 2021 Ceuta crisis demonstrated how quickly deteriorating political relations could produce consequences directly visible on Spanish territory. Conversely, Morocco also depends on functional relations with Spain and the European Union for legal mobility, economic exchanges and security cooperation.

Beyond migration policy lies a much deeper human reality.

Nearly one million Moroccan nationals reside in Spain, according to figures cited by the Spanish government in late 2025. Moroccans constitute the country’s largest foreign community. The Spanish government also reported that approximately 335,000 Moroccan workers were contributing to the Social Security system, more than workers of any other foreign nationality.

The relationship between the two states has therefore also become a relationship between two societies.

A Security Frontier for Europe

Cooperation extends far beyond migration.

Terrorism, drug trafficking, organised crime, human smuggling and maritime surveillance make Morocco a major security partner for Spain.

Criminal networks operating around the Strait exploit precisely the density of exchanges between its two shores. Joint or coordinated operations between Moroccan and Spanish security services have consequently become a regular component of bilateral relations.

This gives Morocco particular importance within Europe’s wider security architecture.

Rabat is neither a member of the European Union nor NATO, but its stability and cooperation have direct consequences for the security of Europe’s southern frontier.

For Madrid, maintaining functional relations with Rabat is therefore less a matter of diplomatic preference than a geographic imperative.

Energy Is Also Connecting the Two Shores

Ships are not the only things crossing the Strait. Energy infrastructure does too.

The Spanish and Moroccan electricity systems are interconnected, creating one of the few significant physical links between European and African electricity grids.

As Morocco expands its solar and wind generation capacity, this connection acquires additional strategic significance.

Europe is seeking to diversify its energy supplies while decarbonising its economy. Morocco possesses substantial renewable resources and aims to develop industrial sectors linked particularly to green hydrogen.

This does not mean Morocco will automatically become a major energy supplier to Europe. Costs, infrastructure requirements, efficiency, domestic demand and commercial viability will remain decisive.

But geography creates a remarkable possibility: transforming the Strait not merely into a commercial route but into an energy corridor between North Africa and Western Europe.

Spain could consequently become a consumer, industrial partner and transit territory simultaneously.

Ceuta and Melilla: The Dispute That Remains

Diplomatic normalisation does not resolve every territorial issue.

Ceuta and Melilla remain under Spanish sovereignty, and Madrid does not consider their status negotiable. Morocco has historically challenged that sovereignty.

What has changed is that both governments increasingly have an interest in preventing the dispute from contaminating the broader relationship.

The cities have also become laboratories for border management. Cross-border trade, passenger movements, customs controls and migration are directly affected by political relations between Madrid and Rabat.

Recent developments therefore suggest less a resolution of the dispute than a strategy of compartmentalisation: preserving disagreements while expanding cooperation elsewhere.

The ability to isolate contentious issues may prove essential to the relationship’s future stability.

Algeria, the Invisible Third Actor

The Spain-Morocco relationship cannot be fully understood without introducing a third country: Algeria.

Rabat and Algiers are engaged in a profound regional rivalry. Western Sahara represents one of its central dimensions, with Algeria supporting the Polisario Front while Morocco considers the territory an integral part of the Kingdom.

Spain must therefore manage two essential relationships that are not always easy to reconcile.

Morocco has become its principal strategic partner in the Maghreb on trade, migration and security. Algeria simultaneously remains a major energy actor and an indispensable Mediterranean partner.

Spain’s 2022 repositioning on Western Sahara consequently affected relations between Madrid and Algiers.

Spain sits at the centre of a delicate geopolitical balance: deepening its partnership with Rabat without turning that relationship into systematic alignment in the Moroccan-Algerian rivalry.

This equation is likely to remain one of the principal constraints on Spanish policy in North Africa.

2030: A Historic Accelerator

The 2030 FIFA World Cup now adds another dimension to relations between Spain and Morocco.

Joint organisation by Spain, Morocco and Portugal requires the three states to cooperate on issues extending far beyond football: transport, infrastructure, security, tourism, mobility, telecommunications and logistics.

Madrid and Rabat already officially describe the event as an opportunity for deeper economic cooperation. At their December 2025 High-Level Meeting, both governments explicitly identified the World Cup as a potential catalyst for new projects.

Its symbolic significance may be even greater.

For the first time, a World Cup will be jointly hosted on both sides of the Mediterranean and the Strait of Gibraltar.

The tournament will provide a spectacular representation of a geographic reality that has existed for millennia: southern Europe and North Africa are separated by only a narrow stretch of water.

Towards an Iberian-Moroccan Axis?

The central question therefore goes beyond diplomatic normalisation.

It is how far integration can ultimately go.

An axis connecting Portugal, Spain and Morocco would bring together close to 90 million people while directly linking the European Union, the Atlantic, the Mediterranean and West Africa.

Spain possesses a developed economy, European infrastructure, significant industrial capabilities and access to the Single Market. Morocco has a younger population, an expanding industrial base, major port infrastructure, substantial renewable-energy potential and a privileged geographic position towards Africa.

The complementarities are substantial.

They do not imply automatic convergence. Development gaps remain significant. Agricultural interests can conflict. Migration can again become politically explosive. Territorial disputes have not disappeared. Western Sahara remains legally and diplomatically sensitive. Political changes in either country could also alter the equilibrium.

Yet something more structural is now taking place.

Geography Always Returns

For much of the twentieth century, Spain looked towards Europe while Morocco sought to consolidate its independence and regional position.

Their proximity was frequently perceived as a source of problems.

In the twenty-first century, that same proximity is increasingly becoming an asset.

Industrial supply chains intersect. Electricity grids connect. Ports operate within the same maritime system. Companies invest on both shores. Hundreds of thousands of Moroccans work in Spain. Security services cooperate. Governments coordinate migration policies. And the two countries will jointly prepare one of the largest sporting events in the world.

None of this turns Spain and Morocco into allies without disagreements.

It creates something potentially more durable: a relationship in which the cost of rupture is continuously increasing.

That may be the real strategic transformation taking place around the Strait of Gibraltar.

For centuries, the Strait has been described as a frontier between two continents, two worlds and two political spaces.

It could gradually become precisely the opposite: one of the principal junctions between Europe and Africa.

Main Sources

  • Government of Spain — Presidency of the Government and Ministry of Foreign Affairs: Spain-Morocco bilateral relations, the roadmap initiated in 2022 and the 13th High-Level Meeting of December 2025.
  • Government of Spain — official data on Spain-Morocco merchandise trade in 2024.
  • Government of Spain — statements by Pedro Sánchez before the Congress of Deputies concerning Western Sahara and relations with Morocco, 2022.
  • Government of Spain — cooperation on investment, transport and infrastructure, 13th High-Level Meeting, December 2025.
  • Government of Spain — social, migration, agricultural and fisheries cooperation with Morocco.
  • Court of Justice of the European Union — judgments of 4 October 2024 concerning Western Sahara and EU-Morocco agreements.
  • European Council — October 2024 conclusions concerning the strategic partnership between the European Union and Morocco.