Energy ties between Morocco and Spain reveal a strategic imbalance often overshadowed by political disputes, migration crises, or territorial claims. While Rabat asserts its sovereignty over Ceuta and Melilla, the kingdom’s energy security remains tightly linked to Spanish infrastructure.
Beyond the high-profile disagreements between Madrid and Rabat, one critical factor shapes the power dynamic: energy. The Moroccan economy, heavily reliant on imported fuels, depends on two key Spanish-controlled networks—the gas pipeline system and interconnections of the Iberian electricity grid.
This dependence creates a paradox. Despite frequent challenges to Spain’s territorial integrity, Morocco continues to depend on Spanish-controlled energy routes for its daily operations.
The reversal of the Maghreb-Europe gas pipeline
Morocco’s energy vulnerability deepened after a rupture in relations with Algeria in 2021. That year, Algiers halted natural gas transit through the Maghreb-Europe pipeline, which had long supplied Spain via Morocco. The shutdown forced a complete reconfiguration of regional energy flows.
Instead of receiving Algerian gas, the pipeline reversed direction. Spain began exporting gas to Morocco through the same infrastructure. By 2025, data shows Rabat imported 10.3 TWh of gas—nearly a quarter of Spain’s total gas exports—valued at roughly 400 million euros.
Rabat’s push for energy autonomy
Aware of its exposure, Morocco is investing in alternative supplies. The Nador West Med LNG terminal is under construction to allow direct maritime gas imports and reduce reliance on Spanish pipelines. Another ambitious project, the Nigeria-Morocco gas pipeline, aims to connect West African gas fields to North African markets, potentially reshaping regional energy trade.
Yet these long-term solutions cannot immediately replace Spanish infrastructure. Until they become fully operational, Morocco remains dependent on Spanish gas transit and electricity interconnections.
Electricity ties: Spain’s silent leverage
Morocco’s energy reliance isn’t limited to gas. Two undersea cables link its grid to Spain’s, with a combined capacity of 1,400 MW. In 2025, Spain exported 3,743 GWh of electricity to Morocco—a 47.5% increase from the previous year and the highest volume since 2017.
The flow overwhelmingly favors Spain. Nearly three-quarters of the interconnection’s capacity carries electricity from the Iberian Peninsula to Morocco. This connection isn’t just commercial; it supports Morocco’s growing energy demand as the country expands renewable projects and industrial zones.
Madrid and Rabat are now discussing a third undersea cable to further increase exchange capacity between both nations.
Ceuta and Melilla: a striking energy contrast
The situation highlights an ironic disparity. While Morocco benefits from direct access to the European electricity grid via Spain, Ceuta—a Spanish enclave on Moroccan soil—has long operated as an isolated energy island. A new 300-million-euro undersea cable, set for completion in 2026, will finally connect Ceuta to mainland Spain. Melilla, however, remains cut off due to geographical distance.
The contrast is telling: Morocco’s mainland is linked to Europe’s energy network, while part of Spain itself remains energy-isolated.
Energy interdependence: a new dimension in power dynamics
These energy ties were once viewed primarily through an economic lens. But in today’s tense Mediterranean and North African geopolitical climate, they carry new strategic weight.
While Spain has no immediate incentive to weaponize its energy exports—cutting supplies would trigger severe economic and diplomatic fallout—the interdependence creates a subtle yet potent lever of influence. Rabat may hold advantages in migration control and security cooperation, but Madrid now holds a critical card in energy security.
Morocco is racing to diversify its energy sources. Still, in the short term, Spain remains the indispensable bridge between Moroccan demand and European supply. As tensions over Ceuta and Melilla persist and geopolitical rivalry intensifies, this energy dependency could become a decisive factor in the Morocco-Spain relationship.