The Fence and the Valve
When Pedro Sánchez called a snap election for 29 November, Alberto Núñez Feijóo did not open his campaign in Madrid. He went to Ceuta, the Spanish enclave on the Moroccan coast, where the arrival of more than 70,000 migrants has become the defining story of Spain’s autumn. Feijóo has called it an operation consented to by Rabat and has said he would deploy the armed forces if he received warning of another mass entry. With the polls pointing to a conservative government, his words are no longer just opposition rhetoric.
Far less has been said on the campaign trail about a number that matters as much. In the first half of 2026, Algeria supplied nearly 34 per cent of the natural gas Spain received, more than the United States. Spain is arguing about who guards a fence. In Rabat and Algiers, they are watching who controls a valve.
A Policy Built on Ambiguity
Stay ahead of the geopolitical week.
MD Briefing delivers expert analysis across five global fronts — the Indo-Pacific, energy, geoeconomics, European security, and the Middle East — every Monday morning. Free.
Sánchez called the vote early after losing a key parliamentary vote on housing. The averages favour the right: an El País forecast puts the People’s Party (PP) on 31.3 per cent, the Socialists on 27 and Vox on 19, with the PP and Vox together close to the 176 seats needed for a majority. The state pollster, the CIS, is the outlier, putting the Socialists clearly ahead.
Spain’s Maghreb policy has rested on a fragile balance since 2022, when Sánchez endorsed Morocco’s autonomy plan for Western Sahara, ending decades of formal neutrality. Algeria, which backs the Polisario independence movement, suspended its friendship treaty with Madrid and restricted trade. This July, Sánchez travelled to Algiers to formalise a fresh start with President Tebboune without reversing his position on the Sahara. The PP, for its part, pushed a parliamentary motion in November 2025 urging Spain to withdraw its support for Morocco’s plan.
From State Policy to Campaign Weapon
Coverage of the campaign treats Morocco as a migration story and the election as a domestic contest over housing, corruption and immigration. That misses the structural change. For decades, Spain’s relations with its two Maghreb neighbours were managed as state policy, insulated from party politics by a deliberate ambiguity on Western Sahara. Since 2022, and especially since Ceuta, that insulation has gone. Vox’s Santiago Abascal has branded Sánchez “the Moroccan candidate in Spain”, and Feijóo has gone as far as threatening to pull Spain out of co-hosting the 2030 World Cup if the final is played in Morocco.
The logical destination of that rhetoric is a rebalancing towards Algeria, and energy is what makes it tempting now. The Iran war has made Gulf supply unreliable and kept attacks on Hormuz shipping in the headlines. Algerian gas reaches Spain directly through the Medgaz pipeline under the Mediterranean, avoiding threatened sea lanes altogether. Algeria’s share of EU pipeline imports has risen to 20 per cent in the first quarter of 2026, and Berlin has rolled out the red carpet for Algiers. As this site has argued, North African gas is becoming a structural pillar of Europe’s energy architecture rather than a stopgap. A Spanish government that restored “neutrality” on the Sahara would find Algiers eager to reward it.
Rabat holds the other lever, and Ceuta has shown how fast it can be pulled. Morocco is Spain’s indispensable partner on border control, returns and counter-terrorism. A government in Madrid that trades Moroccan cooperation for Algerian gas would be exchanging a migration risk for an energy dividend, a choice every Spanish government since the 1970s has worked to avoid by refusing to choose. The danger is not that a PP government would pick a side. It is that campaign promises, a coalition partner hostile to Rabat and an Algiers keen to cash in would push it into choosing faster and louder than any foreign ministry would advise.
This is why the election matters beyond Spain. Ceuta and Melilla are the EU’s only land borders in Africa. Morocco is the Union’s most important migration partner in the western Mediterranean, and Algeria is one of its most valuable gas suppliers in an energy crisis. If Madrid’s Maghreb policy swings with each change of government, both capitals will treat Brussels as an extension of the fight. Rabat could test it at the Ceuta fence, and Algiers could use gas contracts as rewards and punishments, as it used trade against Spain after 2022. Algeria has shown it will use pipelines as political instruments: it shut the Maghreb–Europe pipeline through Morocco in 2021, and it has lain empty since.
The strongest objection is that Feijóo is a pragmatist who would govern differently than he campaigns. There is evidence for that: the PP has repeatedly committed to a balanced, “neighbourly” relationship with both Morocco and Algeria and has kept channels to Rabat open. But pragmatism is harder in coalition. If the PP needs Vox, which is polling near a fifth of the vote, Vox gains a veto over gestures to Rabat. And the commitments made in Ceuta will be quoted back to Feijóo in his first crisis. Sánchez, Rabat’s preferred interlocutor, still felt the need to hedge with Algiers this summer. A government elected on a promise of toughness will have less room, not more.
Three Ways the Maghreb Reads the Result
Base case: tough words, quiet continuity (roughly 55%). A PP-led government with Vox support hardens rhetoric and procedures on migration but leaves the 2022 Sahara position formally untouched, while courting Algiers on gas and trade. Rabat tests the new government with pressure on migration, which is contained by intensive diplomacy. The assumption is that Feijóo’s foreign ministry is run by professionals and that the PP’s coalition agreement with Vox keeps foreign policy off the table. Algiers would likely reward even modest gestures with smoother trade and longer-dated gas contracts.
Downside case: a formal rupture (roughly 25%). The investiture deal with Vox commits Madrid to revisiting the Sahara position or to symbolic moves such as the World Cup threat. Rabat responds by relaxing border cooperation, producing another Ceuta-scale surge; Brussels is pulled in, and EU–Morocco migration and fisheries cooperation is strained. For businesses, the exposure is in Spanish exporters to Morocco, Mediterranean shipping and any firm relying on calm at the Strait of Gibraltar. Gas buyers would face the opposite risk if Algiers read a later correction as betrayal and repriced contracts.
Upside or alternative case (roughly 20%). Either the CIS is right and Sánchez survives, which means continuity, or a PP government uses its opening to Algiers to broker an EU-level gas and investment package with Algeria while keeping Rabat’s core interests intact. That would restore Spain’s old balance from a position of strength, with Madrid as Europe’s energy and migration broker rather than the ground on which Maghreb rivals fight.
Ambiguity Was the Policy
Spain’s Maghreb diplomacy used to work because it was boring: ambiguous on the Sahara, transactional with both neighbours, and kept out of elections. The 2026 campaign has made it loud, and in a year when the Gulf is unreliable and Ceuta has shown how quickly migration can be weaponised, loud is expensive for Spain and for the EU.
Watch two things after 29 November. First, whether any investiture agreement with Vox mentions Morocco, Western Sahara or Ceuta. Second, the new prime minister’s first foreign trip, Rabat or Algiers. The new chambers must be constituted by 24 December, so the signal will arrive before the new year.
Spain’s next government will discover what its predecessors knew: on the southern shore, every gesture to one capital is read as a message to the other.

