Spain’s hidden leverage over Morocco in energy ties

Energy infrastructure between Morocco and Spain

Behind the recurring diplomatic tensions between Morocco and Spain—whether over migration flows, territorial disputes, or security cooperation—lies a less visible but strategically crucial factor: energy dependency. While Rabat frequently asserts its claims over Ceuta and Melilla, the kingdom’s energy supply remains heavily reliant on Spanish infrastructure, creating an unexpected imbalance in their bilateral relationship.

Morocco currently imports all its piped natural gas from Spain, while its electrical grid is interlinked with the Iberian Peninsula. These connections provide the North African nation with critical flexibility and backup capacity, especially as domestic energy demand rises and renewable energy projects expand. Yet this reliance also exposes Rabat to leverage it cannot easily escape.

Despite Morocco’s periodic challenges to Spanish sovereignty over certain territories, its energy security continues to depend on systems operated or controlled from Madrid. This paradox highlights how geopolitical disputes and energy realities often pull in opposite directions.

How the Maghreb-Europe pipeline flipped direction

The turning point came in 2021, when Algeria refused to renew the Maghreb-Europe Gas Pipeline (GME) agreement that had long allowed Algerian gas to transit Morocco en route to Spain. Following the rupture in Algerian-Moroccan relations, the pipeline’s flow was reversed.

Previously, the GME carried Algerian gas across Morocco to Spain. Today, after Spain regasifies liquefied natural gas (LNG) at its terminals and imports it via the Medgaz pipeline, the GME now transports Spanish gas back to Morocco. In 2025 alone, the kingdom received approximately 10.3 terawatt-hours of gas through this route, worth close to €400 million—a volume equivalent to about a quarter of Spain’s total gas exports that year.

This shift transformed what was once a transit corridor for Morocco into a supply channel controlled by Spanish infrastructure, further tightening the energy embrace between the two neighbors.

Rabat’s push for energy autonomy

Moroccan authorities are not oblivious to this vulnerability. A series of major energy projects reflect a clear strategy to diversify import routes and reduce dependence on Spanish systems.

Among the most significant is the future Nador West Med LNG terminal, designed to allow Morocco to import liquefied gas directly by sea and feed it into the Maghreb-Europe pipeline network. The goal is to gradually diminish reliance on Spanish regasification plants and cross-border connections.

Long-term plans also include the Nigeria-Morocco gas pipeline, a vast infrastructure project intended to link West African gas reserves with northern markets. If completed, it could reshape the regional energy landscape. Yet these initiatives require years of investment and construction, leaving Morocco exposed in the short term.

For now, Spain remains Morocco’s indispensable gateway for both gas and electricity, giving Madrid a subtle but powerful card in any future negotiations.

Electricity flows tilt in Spain’s favor

The energy interdependence extends beyond gas. Two undersea cables link the Spanish and Moroccan electrical grids, with a combined capacity of 1,400 megawatts. In 2025, Spain exported a net 3,743 gigawatt-hours of electricity to Morocco—a 47.5 percent increase from the previous year and the highest level since 2017.

Nearly three-quarters of the available capacity on these interconnections flows from Spain to Morocco, underscoring the direction of the energy exchange. While the connection supports Moroccan grid stability amid rising demand and renewable expansion, it also embeds Spanish influence in the kingdom’s energy security.

Plans are already underway for a third undersea cable, which would further expand the bidirectional flow of electricity and deepen the integration between the two systems.

The Ceuta and Melilla paradox

This energy cooperation reveals another contradiction in the Morocco-Spain relationship. Despite Morocco’s integration into the European electricity network via Spain, the Spanish enclaves of Ceuta and Melilla have long operated as energy islands, disconnected from the mainland grid.

Ceuta is set to break this isolation in 2026 with a new undersea cable linking it to the Iberian Peninsula. The €300 million project aims to enhance supply security for the city. Melilla, however, will remain isolated due to its greater distance from the mainland.

The contrast is striking: Morocco’s mainland enjoys seamless connectivity to Europe’s energy system through Spain, while a portion of Spanish territory still relies on autonomous power arrangements. It is a reminder that energy geography does not always follow political boundaries.

A new dimension in geopolitical bargaining

Energy networks have traditionally been seen through an economic lens. Yet with renewed tensions across the Mediterranean and North Africa, these infrastructure links now carry geopolitical weight. They create structural vulnerabilities that can translate into influence, even if neither side actively weaponizes them.

An intentional disruption of gas or electricity flows would carry heavy economic, diplomatic, and legal consequences. But the very existence of this interdependence introduces a subtle asymmetry into the Morocco-Spain equation. While Rabat holds significant cards in migration control, security cooperation, and territorial disputes, Madrid wields a less visible but equally potent lever through energy infrastructure.

Until now, many analyses have portrayed Morocco as the dominant player in the bilateral relationship. Yet the energy dimension flips part of that narrative. It introduces an element of constraint that Rabat must navigate carefully, even as it pursues ambitious projects to diversify its supply.

Madrid’s strategic advantage in the energy standoff

Morocco is actively seeking to reduce its energy dependence on Spain. The Nador West Med terminal and the proposed Nigeria-Morocco pipeline are clear steps in that direction. Yet neither solution can replace Spanish infrastructure in the near term.

The current reality places Spain in a unique position: it is both the main entry point for Morocco’s piped gas imports and the bridge connecting the Moroccan grid to the wider European electricity network. In a context of rising tensions over Ceuta and Melilla and intensifying geopolitical rivalry in the western Mediterranean, this energy interdependence could become a decisive factor in the balance of power between the two kingdoms.

Morocco possesses formidable tools in its dealings with Spain. Yet Spain, in turn, holds an equally powerful—if less visible—asset. On the energy front, Rabat’s reliance on Spanish infrastructure may well be the most underestimated counterweight in this complex and evolving relationship.