Gas pipelines, electricity grids, and critical infrastructure: beneath the recurring tensions between Morocco and Spain lies an energy dependency far less visible than migration crises or territorial disputes. While Rabat asserts its geopolitical ambitions over Ceuta and Melilla, its energy system remains heavily reliant on Spanish-controlled networks.
In the ongoing geopolitical tug-of-war between Madrid and Rabat, power dynamics are typically assessed through migration control, security cooperation, Western Sahara, or Morocco’s claims over Ceuta and Melilla. Yet another, far less discussed dimension places Spain in a strategically advantageous position: energy.
Morocco currently imports all its piped gas from Spain, and its electrical grid depends on interconnections with the Iberian Peninsula to ensure stability and flexibility. This creates a paradox in bilateral relations: while Rabat frequently challenges Spanish sovereignty over certain territories, its energy supply remains partially tied to infrastructure operated or controlled by Madrid.
Reversal of the Maghreb-Europe pipeline
The shift in Morocco’s energy dependency became particularly pronounced after the rupture with Algeria.
In 2021, Algiers decided not to renew the Maghreb-Europe Gas Pipeline (GME) agreement, which had previously allowed Algerian gas to transit through Morocco en route to Spain. The collapse of diplomatic ties between Algeria and Morocco fundamentally altered the pipeline’s operational role.
The pipeline’s flow direction was reversed. Having previously relied on Algerian gas via the Medgaz pipeline and liquefied natural gas (LNG) via regasification terminals, Spain began supplying gas to Morocco through the GME.
What was once Morocco’s transit route for Algerian gas now functions as a conduit for Moroccan imports sourced indirectly through Spanish infrastructure. According to available data, Morocco received approximately 10.3 TWh of gas in 2025, valued at nearly 400 million euros—roughly one-quarter of Spain’s total gas exports that year.
Rabat’s push for energy independence
Morocco is not unaware of this vulnerability. Recent and upcoming energy projects reflect a deliberate effort to diversify supply routes.
One key initiative is the Nador West Med LNG terminal, designed to enable Morocco to import liquefied natural gas directly by sea and inject it into the Maghreb-Europe pipeline network. The goal is clear: gradually reduce reliance on Spanish terminals.
Another cornerstone of Morocco’s energy strategy is the planned Nigeria-Morocco Gas Pipeline, a massive infrastructure project intended to link West African gas reserves with northern markets. If completed, it could reshape the regional energy balance.
However, such projects require significant time and investment. For now, Spain remains an irreplaceable short-term partner in Morocco’s gas supply chain.
Electricity: another strategic lever
Energy interdependence extends beyond gas. Two subsea cables currently connect Morocco’s electrical grid to Spain’s, with a combined capacity of 1,400 MW.
Official figures show Spain exported a net 3,743 GWh of electricity to Morocco in 2025, a 47.5% increase year-on-year and the highest level since 2017. About 75% of the interconnection’s capacity is used for flows from the Iberian Peninsula to Morocco.
This connection serves more than commercial interests—it provides Morocco with additional grid capacity as demand rises and the country expands its renewable energy and industrial infrastructure. Both countries are also exploring the construction of a third subsea cable to further enhance power exchange.
The Ceuta and Melilla paradox
The energy interdependence highlights another contradiction. Despite Morocco’s decades-long connection to the European grid via Spain, the Spanish cities of Ceuta and Melilla have historically operated as energy islands, disconnected from the mainland grid.
While Ceuta is set to break this isolation in 2026 with a new subsea cable—an investment of approximately 300 million euros—Melilla will remain isolated due to its geographic distance.
The contrast is striking: continental Morocco is linked to Europe’s electrical network through Spain, while parts of Spanish territory still rely on standalone energy systems.
How energy dependency reshapes geopolitics
These infrastructures have long been viewed primarily through an economic lens. But in today’s tense Mediterranean and North African geopolitical climate, their significance has grown.
While Spain has no apparent interest in weaponizing energy flows, an intentional disruption would carry substantial economic, diplomatic, and legal consequences. This interdependence creates structural vulnerability—and thus potential leverage.
To date, Morocco has often held the upper hand in bilateral disputes, particularly on migration control, counterterrorism cooperation, and pressure over Ceuta and Melilla. Energy introduces a new dimension where Spain gains strategic influence.
Spain holds its own cards
Morocco is actively working to reduce its energy dependence on Spain, as evidenced by the Nador West Med terminal and the Nigeria-Morocco pipeline. Yet neither alternative can immediately replace existing Spanish infrastructure.
For now, Spain remains central to Morocco’s energy security: it is both the gateway for piped gas imports and the bridge connecting Morocco’s electrical grid to Europe. In a climate marked by tensions over Ceuta and Melilla and broader geopolitical rivalry in the western Mediterranean, this energy reality could become a far more pivotal factor in the power balance between the two kingdoms.
Morocco possesses considerable leverage over Spain. But the reverse is also true. And in the energy sector, Rabat’s reliance on Spanish infrastructure may well be the most concealed counterweight in their complex, evolving relationship.