Why Is Madrid Pandering to Morocco?

Spain has traded five decades of neutrality on Western Sahara while getting nothing but a spyware scandal in return.

By , a Spain-based journalist and researcher.
Demonstrators wave Western Sahara flags during a protest against the Spanish government support for Morocco's autonomy plan for Western Sahara, in Madrid, on March 26.
Demonstrators wave Western Sahara flags during a protest against the Spanish government support for Morocco's autonomy plan for Western Sahara, in Madrid, on March 26.
Demonstrators wave Western Sahara flags during a protest against the Spanish government support for Morocco's autonomy plan for Western Sahara, in Madrid, on March 26. PIERRE-PHILIPPE MARCOU/AFP via Getty Images

Spain’s foreign policy strives to secure the country’s status as a relevant middle power with a voice in Latin America, Europe, and the Mediterranean Basin. In North Africa, however, Madrid is skating on thin ice.

Spain’s foreign policy strives to secure the country’s status as a relevant middle power with a voice in Latin America, Europe, and the Mediterranean Basin. In North Africa, however, Madrid is skating on thin ice.

Matters first turned sour following then-U.S. President Donald Trump’s recognition in December 2020 of Moroccan sovereignty over occupied Western Sahara—a former Spanish colony. Spain refused to follow suit and faced months of wrath from the Moroccan monarchy after authorities allowed Brahim Ghali—the leader of the Polisario Front, which resists Moroccan control of the territory—into a Spanish hospital for COVID-19 treatment. Rabat retaliated by recalling its ambassador.

The 15-month-long row included several spats in which Morocco weaponized thousands of people—including hundreds of its own underage nationals—as diplomatic ammunition. The kingdom repeatedly halted border patrols, letting dozens of migrant boats reach the Spanish Canary Islands and allowing thousands of fence crossings into the Spanish exclaves Ceuta and Melilla, on Africa’s mainland.

In mid-2021, Spanish Prime Minister Pedro Sánchez’s phone was twice hacked by the Israel-developed malware Pegasus; Morocco is the prime suspect, leading to fears Rabat is seeking to blackmail Madrid.

In May and June 2021, during the peak of the confrontation, Spanish Prime Minister Pedro Sánchez’s phone was twice hacked by the Israel-developed malware Pegasus. So was a phone belonging to then-Foreign Minister Arancha González Laya, as well as the phones of Defense Minister Margarita Robles and Interior Minister Fernando Grande-Marlaska. Agriculture Minister Luis Planas, a former Spanish ambassador to Morocco, suffered a failed attempt.

Given that a single Pegasus customer targeted over 200 Spanish phones, including the Morocco-focused journalist Ignacio Cembrero’s, all signs point to Morocco. Since the scandal erupted earlier this month, the Spanish government has denied Morocco’s responsibility and sacked Madrid’s spy chief. Despite knowing about the attacks from the onset, Spain embarked on a host of efforts at reconciliation with Morocco after welcoming the Polisario’s leader.

According to Ali Lmrabet, a Moroccan journalist exiled in Spain and longtime target of the Makhzen—the country’s deep state—Rabat could well be blackmailing Sánchez. He suggests that Morocco’s intelligence services likely found something within the almost 3 gigabytes of data siphoned from Sánchez’s phone. “Blackmailing foreign politicians is their specialty,” he said.

Last July, Sánchez used a cabinet reshuffle to fire González Laya, who had been vilified in the Moroccan press. The pro-Moroccan diplomat and former ambassador in Paris José Manuel Albares took her place. Weeks later, Spanish King Felipe VI highlighted the two countries’ “deep shared friendship” in a written tribute to mark Moroccan King Mohammed VI’s 22nd anniversary on the throne. When, last fall, Algeria cut off gas shipments to its neighbor Spain intervened to secure Morocco’s energy supply. Still, none of the gestures seemed to satisfy Rabat.

Eventually, Sánchez caved on the biggest issue of all—fearing the consequences of Rabat’s freeze in immigration deterrence and the economic asphyxia caused by the Moroccan border closures on the frontier with Ceuta and Melilla. In a letter to King Mohammed VI dated March 14, Sánchez dubbed the 2007 Moroccan proposal of Sahrawi autonomy under Rabat’s control in Western Sahara “the most serious, credible, and realistic basis” toward resolving the conflict. Four days later, the Moroccan palace leaked the diplomatic missive to the press.


The tilt toward Morocco undoes half a century of formal Spanish neutrality in the conflict between Morocco and the Polisario. Crucially, the new stance lands Madrid closer to Rabat’s position than either Berlin’s or Paris’s; both Germany and France have acknowledged the autonomy plan as merely “a contribution” but abstained from superlatives. After 10 months, the lights are on again in Morocco’s ambassadorial residence in Madrid. It hasn’t been cost-free.

“To exit the Rabat quagmire, you have triggered a crisis with Algeria, a crisis within the government, and a crisis … in this chamber,” Cuca Gamarra, the spokesperson of Spain’s main opposition party, chastised Sánchez on March 30. Several parties had summoned the prime minister to the Spanish parliament to explain a historic about-face they only learned about from the Moroccan palace. “It’s humiliating,” Gamarra said.

The pivot has sparked widespread condemnation across the political spectrum—from Vox to Podemos—a rarity in Spain’s fragmented political landscape.

Indeed, the pivot has sparked widespread condemnation across the political spectrum, a rarity in Spain’s fragmented political landscape. Far-right Vox called it “a damn insult.” In turn, the ruling coalition’s junior leftist partner, Podemos, deplored it as “regrettable.” In the lead-up to Sánchez and Albares’s upcoming visit to Rabat, the spokesperson of the Basque Nationalist Party, Aitor Esteban, reminded the foreign minister of his lack of an endorsement from parliament.

But, above all, the U-turn has enraged Algeria, the EU’s third-largest gas provider but also Morocco’s foe and the Polisario’s staunchest ally, at a critical time. Russia has cut gas to Poland and Bulgaria, and Algeria’s goodwill is as critical as ever. The country swiftly withdrew its ambassador to Madrid after the pivot. For Eduard Soler, a senior researcher at the Barcelona Center for International Affairs, “Whoever says that they know what the Algerian response will be is giving you inaccurate information.” Soler told Foreign Policy that “Algeria is currently going through a process to craft one.”

Indeed, Algiers warned Madrid it would review “all its agreements … in all areas.” In the aftermath of the shift, Spain tried to appease Algeria by hastily handing over asylum-seeker Mohamed Benhalima, a former military officer who became prominent after exposing the Algerian regime’s corruption and joining the country’s Hirak protests. Despite Amnesty International’s warnings of the “high risk of torture” he faced back home, Spain ignored its international obligations as a signatory of the United Nations’ Convention against Torture and summarily rejected his asylum request. Algeria has since stopped accepting repatriations of its irregular migrants from Spain and drastically slashed the number of flights between the two countries.

Benhalima, for his part, swiftly “confessed” all charges against him on Algerian TV after his refoulement. In a previous video, though, the dissident warned that any such confession would constitute proof of “severe torture.” The Spanish government has not yet responded to a congressional petition asking the Ministry of the Interior to justify the repatriation. This week, Benhalima was sentenced to death.


The only silver lining in Spain’s newest Maghreb crisis seemed to be that the gas tap wouldn’t be shut off. (Spain sources almost half of its gas needs from Algeria.) “Algeria wants to build the image of a reliable supplier,” Soler said, a sentiment echoed by Gonzalo Escribano, director of the Energy and Climate Program at Spain’s Elcano Royal Institute.

Escribano notes that Algiers cannot do without revenue originating from exports to Spain. Still, the sword of Damocles is hanging over Madrid. Late last month, Algeria threatened to terminate gas exports should Spain supply Morocco with Algerian oil. Madrid has since vowed to only pump non-Algerian gas through the pipeline that connects Spain to Morocco.

“There’s been a lot of talk of Spain missing the chance to become Europe’s energy hub due to Algerian retaliation after the pivot,” Escribano said. “Honestly, it doesn’t make sense; Algeria lacks the ability to make up for a hypothetical halt in Russian exports, and, in turn, Spain lacks the capacity to export it northward through the Pyrenees.” Algeria has, however, declared its relationship with Italy “strategic” and vowed to increase its gas exports by 50 percent to the country. Algiers also intends to favor Rome over Madrid in the future. The impact of this riposte is limited. While the CEO of Sonatrach—Algeria’s national state-owned oil company—doesn’t rule out a price increase, its consequences would be far from catastrophic.

“It’s a mistake how the ministry is handling all this affair with Morocco. It’s a capitulation,” said a Spanish diplomat who has been stationed in the region several times, speaking on condition of anonymity. “When it comes to Rabat, you don’t assert your interests [by] yielding every time there’s an incident.” Asked about the ostensible hastiness of the move, the diplomat replied that the foreign minister’s political survival was contingent on his handling of the affair.

Diplomatic sources confirmed to Foreign Policy that Albares and his team had negotiated the pivot without seeking advice from the usual informal diplomatic network of experts on Western Sahara.

And so far, the government has little to show for it. Although the border crossings between Morocco and two North African exclaves of Ceuta and Melilla are scheduled to open next week—but without customs checks, as Spain had promised earlier—Morocco has continued to grow increasingly aggressive. Amnesty International reported that “Moroccan authorities have stepped up their harassment of human rights defenders and activists in the past two months.” In April, Algeria denounced Morocco’s bombing of a truck convoy on the border between Mauritania and Western Sahara.

Regarding the prospects for Morocco-Spain relations, Soler is wary of pompous talk of a fundamental revamp. He wondered “To what extent having closed the diplomatic crisis like this lays a more solid foundation?” in reference to the foreign ministry’s secretive ways and Morocco’s leak of Sánchez’s letter.

The former diplomat quoted above concurred with Soler’s qualms about the future of bilateral relations, specifically with regards to the weaponization of migrants—a move described by Spain as “blackmail.”

“These are the ways and means of the palace, now and in the future,” the diplomat asserted, referring to the Moroccan monarchy. Various experts consulted for this article repeatedly identified fear of Morocco’s weaponization of migration as Spain’s “Achilles’ heel.” At the same time, Spain welcomed 134,000 Ukrainians in the first two months after the start of the war, showing humane treatment of migrants is possible, according to Human Rights Watch. Not so in the Mediterranean, it seems, where stasis and the securitization of borders are alive and well. In 2019—before the outbreak of the Morocco-Spain crisis—Rabat claimed to have stopped 70,000 attempts at irregular migration that year.

Finally, Spain’s rapprochement with Morocco takes place at a time when the North African kingdom’s diplomacy is treading a tightrope. Regarding Ukraine, Morocco’s no-show at two U.N. General Assembly resolution votes on Russia’s invasion testifies to Rabat’s entente with Moscow—so much so that Ukrainian President Volodymyr Zelensky recalled his ambassador to Rabat after Moroccan Foreign Minister Nasser Bourita burst into laughter at a journalist’s question about Morocco’s stance on the war.


By endorsing the Moroccan autonomy plan in Western Sahara and tilting toward a Russia-friendly Rabat, Madrid’s claim that it is promoting a rules-based international order rings hollow. One would be hard-pressed to imagine Spain declaring autonomy within Russia as “the most serious, credible, and realistic basis” to resolve the conflict in Ukraine’s Donbas region. Why then, Spanish citizens seem to be asking, is it acceptable to do so in Western Sahara?

With 70 percent of Spaniards backing Sahrawi independence and more than 80 percent of Sánchez’s voters doing so, the move is far from popular. Several hundred people showed up in front of the Spanish foreign affairs ministry’s headquarters to protest the pivot.

Spain has shown the Moroccan monarchy that tantrum diplomacy pays off.

In the end, Spain has shown the Moroccan monarchy that tantrum diplomacy pays off. The EU has for years espoused a trade-centered foreign policy, both eastward and southward. It is telling that Germany’s “change through trade” policy is crumbling in Russia at the same time as Spain’s “mattress of interests” does so in Morocco. The “mattress” expression posits that a host of shared interests would cushion the Rabat-Madrid relationship if frictions arose. Yet, it has proved futile despite Spain being Morocco’s biggest trading partner.

To break the deadlock, the former Spanish diplomat suggests a way forward. “The Moroccans have very successfully diagnosed our weaknesses … and they are determined to take it to the limit. Our rulers, though, have miserably failed to identify what levers we have,” he said.

These range from trade, human rights, development aid, and gas sent to Morocco through the Maghreb-Europe pipeline to the peace process with the Polisario, northern Morocco’s economic dependence on Ceuta and Melilla, and Spain’s mediation in favor of Morocco in EU forums. Virtually each and every shared interest that makes up the so-called mattress can be wielded as diplomatic leverage against Rabat, but the Sánchez government is using none of these tools.

Ultimately, it’s up to Spain’s government to clean up the mess it has made of the country’s Western Sahara policy. Having a plan for next time Morocco’s tantrum diplomacy is set in motion is the only way.

Marcos Bartolomé is a Spain-based journalist and researcher. He co-founded the international media outlet El Orden Mundial and holds a master’s in Arab studies from Georgetown University’s School of Foreign Service.

Join the Conversation

Commenting on this and other recent articles is just one benefit of a Foreign Policy subscription.

Already a subscriber? .

Join the Conversation

Join the conversation on this and other recent Foreign Policy articles when you subscribe now.

Not your account?

Join the Conversation

Please follow our comment guidelines, stay on topic, and be civil, courteous, and respectful of others’ beliefs.

You are commenting as .

More from Foreign Policy

The USS Nimitz and Japan Maritime Self-Defense Force and South Korean Navy warships sail in formation during a joint naval exercise off the South Korean coast.
The USS Nimitz and Japan Maritime Self-Defense Force and South Korean Navy warships sail in formation during a joint naval exercise off the South Korean coast.

America Is a Heartbeat Away From a War It Could Lose

Global war is neither a theoretical contingency nor the fever dream of hawks and militarists.

A protester waves a Palestinian flag in front of the U.S. Capitol in Washington, during a demonstration calling for a ceasefire in Gaza. People sit and walk on the grass lawn in front of the protester and barricades.
A protester waves a Palestinian flag in front of the U.S. Capitol in Washington, during a demonstration calling for a ceasefire in Gaza. People sit and walk on the grass lawn in front of the protester and barricades.

The West’s Incoherent Critique of Israel’s Gaza Strategy

The reality of fighting Hamas in Gaza makes this war terrible one way or another.

Biden dressed in a dark blue suit walks with his head down past a row of alternating U.S. and Israeli flags.
Biden dressed in a dark blue suit walks with his head down past a row of alternating U.S. and Israeli flags.

Biden Owns the Israel-Palestine Conflict Now

In tying Washington to Israel’s war in Gaza, the U.S. president now shares responsibility for the broader conflict’s fate.

U.S. President Joe Biden is seen in profile as he greets Chinese President Xi Jinping with a handshake. Xi, a 70-year-old man in a dark blue suit, smiles as he takes the hand of Biden, an 80-year-old man who also wears a dark blue suit.
U.S. President Joe Biden is seen in profile as he greets Chinese President Xi Jinping with a handshake. Xi, a 70-year-old man in a dark blue suit, smiles as he takes the hand of Biden, an 80-year-old man who also wears a dark blue suit.

Taiwan’s Room to Maneuver Shrinks as Biden and Xi Meet

As the latest crisis in the straits wraps up, Taipei is on the back foot.