For four years, Spain and Morocco have built a relationship whose main achievement has been its ability to withstand its own contradictions. Madrid could support Morocco’s autonomy plan for Western Sahara while asserting its sovereignty over Ceuta and Melilla. Rabat could maintain its claims over the two cities while cooperating with Spain on migration, security, trade and, soon, the organisation of the 2030 World Cup. Each side knew the other’s red lines. The essential task was to keep them from colliding.

Spain’s decision to hold an early general election on 29 November 2026 introduces a new variable into that balance. For the first time since the 2022 rapprochement, the political architecture built between Rabat and Madrid may have to function without one of its principal architects.

Pedro Sánchez announced on 5 October the dissolution of the Cortes and the election for 29 November, following another parliamentary defeat for his government over housing. The election will primarily be fought over domestic Spanish issues — housing, purchasing power, political fragmentation, immigration and the functioning of institutions — and its outcome remains open. But for Morocco, it also represents a diplomatic test: determining which parts of the rapprochement with Madrid have become structural Spanish state policy and which still depend on Sánchez’s personal and political choices.

That distinction has become essential. A THE 2022 TURN

The current relationship effectively begins in March 2022.

After nearly a year of diplomatic crisis, Pedro Sánchez changed Spain’s position on Western Sahara. Madrid began describing Morocco’s 2007 autonomy initiative as the “most serious, realistic and credible” basis for resolving the conflict.

For Rabat, the shift was considerable. The former administering power moved closer to the Moroccan position without formally recognising Moroccan sovereignty over Western Sahara. For Madrid, the decision provided a way out of an increasingly costly crisis and allowed cooperation with its southern neighbour to be rebuilt.

The joint declaration of 7 April 2022 organised that normalisation. Migration, security, trade, movement of people, economic cooperation and political dialogue were to be progressively restored.

The method worked.

Morocco became a central partner for Spain in controlling its Mediterranean and Atlantic borders. Bilateral trade reached record levels. Spanish companies expanded their presence in Morocco. Energy and logistics infrastructure brought the two economies closer together. Then the award of the 2030 World Cup to Spain, Morocco and Portugal created a common deadline around which investments will unfold for years.

An interdependence emerged.

But the rapprochement also depended on an implicit rule: territorial disputes had to remain compartmentalised.

TWO TERRITORIAL INTEGRITIES

That architecture has contained a contradiction from the beginning.

Morocco asks its partners to recognise its territorial integrity in Western Sahara. At the same time, Rabat does not recognise Spanish sovereignty over Ceuta and Melilla.

The situations are not legally equivalent.

Western Sahara remains on the United Nations list of Non-Self-Governing Territories, and its final status remains subject to the UN political process. Ceuta and Melilla are Spanish autonomous cities, incorporated into Spain’s constitutional order and into the territory of the European Union.

Diplomatically, however, the symmetry is difficult to ignore.

Rabat asks Madrid to take into account what it regards as a fundamental question of territorial integrity. Madrid demands exactly the same when Ceuta and Melilla are concerned.

For several years, the two capitals succeeded in keeping those two conversations sufficiently far apart.

The summer of 2026 made that much more difficult.

CEUTA CHANGES THE RELATIONSHIP

On 30 and 31 July, more than 70,000 people crossed the border between Morocco and Ceuta in an arrival of exceptional scale. A large proportion subsequently left or were returned, but thousands remained in the city, overwhelming reception capacity and rapidly transforming a migration problem into a Spanish political crisis.

Madrid avoided directly accusing the Moroccan government of organising the crossings. That caution is not incidental: formally attributing the episode to Rabat would have confronted the Spanish government with an immediate contradiction between its strategic partnership with Morocco and the defence of a national border.

But the consequences of the crisis already extend far beyond migration.

Spain is preparing tighter procedures to accelerate the processing of asylum applications and returns from Ceuta. Brussels is simultaneously working to strengthen Frontex capabilities, early-warning systems and European return mechanisms. The crisis has therefore accelerated a deeper movement: Ceuta is becoming less merely a Spanish-Moroccan frontier and more an operationally European border.

King Felipe VI himself articulated that idea at the end of September. What happened in Ceuta, he argued, concerned a Spanish border that is also a border of the European Union.

The monarchy then decided to give that assertion a symbolic expression.

Felipe VI and Queen Letizia will visit Ceuta on 13 October and Melilla the following day. It will be their first official visit to the two cities since Felipe VI acceded to the throne.

The last visit by a Spanish monarch, that of Juan Carlos I in 2007, triggered an immediate diplomatic reaction from Rabat and the recall of the Moroccan ambassador for consultations.

Nineteen years later, the context is different.

The geography is not.

A VISIT BEFORE AN ELECTION

The timing gives the visit additional significance.

The Spanish monarchs will arrive in Ceuta and Melilla less than seven weeks before the general election.

The visit had been under consideration before July’s migration crisis, so it would be inaccurate to portray it simply as a response to the events of the summer. It was nevertheless coordinated between the Royal Household and the Spanish government and will now take place in an entirely different political environment.

From 13 October onward, images of the King of Spain in Ceuta and then Melilla will inevitably enter an election campaign in which migration, borders and relations with Morocco may become points of political confrontation.

For Rabat, the most effective immediate response may be precisely not to turn the visit into a crisis. But the absence of a crisis would itself be politically significant: it would demonstrate how profoundly the relationship built since 2022 has altered the two states’ capacity to absorb their territorial disagreements.

The real uncertainty now comes from the election.

WHAT WOULD SURVIVE SÁNCHEZ

It would be tempting to reduce the Spain-Morocco relationship to a Mohammed VI–Pedro Sánchez relationship.

That would be a mistake.

Since 2022, common interests have become too important to depend entirely on two leaders.

Spain needs Morocco to manage part of its southern borders, combat criminal and terrorist networks and maintain stability in its immediate neighbourhood. Morocco needs Spain as a trading partner, investor, gateway to the European market and an actor capable of defending a pragmatic relationship between Rabat and Brussels.

Geography imposes the rest.

The Strait of Gibraltar is only a few dozen kilometres wide at its narrowest point. Supply chains, ports, energy networks and human movements cross this space every day. No change of majority in Madrid will eliminate that interdependence.

The 2030 World Cup adds another constraint. Over the next four years, Spain and Morocco will have to coordinate infrastructure, transport, security, supporter mobility and sporting organisation with Portugal. Cooperation will therefore cease to be merely diplomatic. It will become increasingly material.

For that reason, a change of government in Madrid would not automatically mean a return to the pre-2022 crisis.

But it could change the terms of the relationship.

THE SAHARA AS THE TEST

Western Sahara would then become the central question.

Spain’s 2022 shift is personally and politically associated with Pedro Sánchez. Yet reversing it is no longer as simple as it would have been when the decision was first taken.

Returning to the previous position would create an immediate crisis with Rabat without necessarily guaranteeing full normalisation with Algiers. Maintaining the current position would preserve the relationship with Morocco but would require a new government to assume ownership of a diplomatic choice whose form it had previously criticised, particularly because of the way Sánchez announced it.

This is where the election becomes particularly important for Rabat.

Morocco no longer merely needs Sánchez to defend the position adopted in 2022. Its implicit diplomatic objective is now considerably more ambitious: to make that position survive Sánchez.

If a politically different government maintains it, the 2022 turn will gradually cease to be the policy of one parliamentary majority and become a Spanish doctrine.

That would probably constitute Rabat’s most important diplomatic gain since the rapprochement began.

Conversely, if the election campaign turns Western Sahara, Ceuta, Melilla or migration cooperation into instruments of domestic confrontation, the fragility of the compromise will become immediately apparent.

ALGERIA IS WATCHING TOO

A third actor is watching the Spanish election: Algeria.

The rupture between Algiers and Madrid following Spain’s change of position on Western Sahara profoundly disrupted Spain’s Maghreb policy. In recent months, Sánchez had been attempting to rebuild relations with Algiers while preserving the rapprochement with Rabat.

It was a difficult but rational strategy: Spain has no strategic interest in choosing permanently between its two major Maghreb neighbours.

Spain’s new political calendar now complicates that normalisation. A new majority could resume the rapprochement with Algiers, slow it down or attempt to redefine it. Once again, Western Sahara would remain at the centre of the equation.

Madrid is therefore rediscovering the fundamental difficulty of any Spanish policy in the Maghreb: improving one relationship almost immediately changes the other.

Rabat and Algiers both know it.

A RELATIONSHIP TOO IMPORTANT TO REMAIN PERSONAL

The 29 November election will not be a referendum on Morocco. Spanish voters will vote primarily on Spain.

But its outcome will help answer a question that four years of rapprochement have not yet resolved.

Pedro Sánchez profoundly changed the relationship with Rabat. He accepted a domestic political cost in order to alter Spain’s position on Western Sahara. Mohammed VI responded by restoring cooperation that now reaches into almost every strategic dimension of the bilateral relationship.

That system has survived diplomatic tensions, territorial contradictions and even an exceptional migration crisis.

It now faces its most difficult test: surviving those who built it.

If the next Spanish government preserves the essentials of the 2022 doctrine, Rabat will have secured something far more durable than a rapprochement with Pedro Sánchez. Morocco will have helped transform its relationship with its northern neighbour into state policy.

If not, November will serve as a reminder of an older truth about the Strait: between Morocco and Spain, geography is permanent, but political equilibria never are.

MAIN SOURCES

  • Reuters, 5 October 2026 — Pedro Sánchez’s announcement of the 29 November early general election and the Spanish political context.
  • EFE, 5 October 2026 — Dissolution of the Cortes and electoral timetable.
  • Reuters, September–October 2026 — Ceuta migration crisis, return policies and evolution of the European response.
  • EFE, 1 October 2026 — Official visit by Felipe VI and Queen Letizia to Ceuta and Melilla on 13–14 October.
  • Government of Spain / La Moncloa — Spain–Morocco Joint Declaration of 7 April 2022 and the framework for the new phase of bilateral relations.
  • United Nations — Status of Western Sahara and the UN-led political process.