Morocco and Spain maintain extensive diplomatic, commercial, and military ties. Morocco’s foreign policy has focused on Western partners, including neighboring Spain. They have however, been historically intense and conflictive.
History
Precedents
After crossing the Strait of Gibraltar in 711, Muslims from North Africa led by the Umayyad commander
Tariq ibn Ziyad seized the
Visigothic Kingdom of Hispania in the wake of the
Islamic conquest of the Iberian Peninsula. In the first generations after the conquest, the
African Romance (argued to be part of a continuum with
Ibero-Romance) presumably spoken by the Berber invaders may have facilitated communication with the native population, prior to the latter's arabization. Following the
Abbasid takeover of the Umayyad caliphate, a branch of Umayyads established an independent
Córdoba-centered Islamic polity in the Iberian Peninsula (initially
an emirate and
later a caliphate), which lasted until its demise in the early 11th century and ensuing replacement by ephemeral Islamic statelets. In the 10th century, Córdoba waged an expansionist policy to expand its clout in the Maghreb, vying a struggle against the
Fatimid Empire
The Fatimid Caliphate was an Ismaili Shi'a caliphate extant from the tenth to the twelfth centuries AD. Spanning a large area of North Africa, it ranged from the Atlantic Ocean in the west to the Red Sea in the east. The Fatimids, a dyna ...
.

Under the
Almoravid and the
Almohad dynasties, both of which had
Marrakesh
Marrakesh or Marrakech ( or ; ar, مراكش, murrākuš, ; ber, ⵎⵕⵕⴰⴽⵛ, translit=mṛṛakc}) is the fourth largest city in the Kingdom of Morocco. It is one of the four Imperial cities of Morocco and is the capital of the Marrakes ...
as a capital, most of the Muslim-controlled territory in the Iberian Peninsula came under Maghrebi imperial rule.
Vowing to counter the Castilian expansion initiated by 1265,
Nasrid Granada required assistance from Fez in late 1274 and ceded the places of
Algeciras and
Tarifa to the
Marinids, which thus gained a foothold in the southernmost end of the Iberian Peninsula. The Marinid grip over Algeciras further increased in the ensuing decades, and the place turned into a Marinid power base from which
razzias were launched into the still incipient Christian settlements in the Lower Guadalquivir and the Guadalete area.
In the aftermath of the
Granada War, the
Catholic Monarchs, with the
Alhambra Decree
The Alhambra Decree (also known as the Edict of Expulsion; Spanish: ''Decreto de la Alhambra'', ''Edicto de Granada'') was an edict issued on 31 March 1492, by the joint Catholic Monarchs of Spain ( Isabella I of Castile and Ferdinand II of Arag ...
of 1492, ordered the expulsion of the
Jews from the crowns of Castile and Aragon. Many of these Jewish refugees settled in the territory of current-day Morocco. Some 40,000 ''
Moriscos'' arrived there after their
final expulsion in 1609, dressed in the Spanish way and speaking Spanish.
Unlike their more welcoming situation in other places of the Maghreb such as Tunis, they were generally not well received, were accused of being Christians and sometimes suffered martyrdom.
''Morisco'' refugees from
Hornachos founded the pirate
Republic of Salé on the
Bou Regreg
The Bou Regreg ( ar, أبو رقراق) is a river located in western Morocco which discharges to the Atlantic Ocean between the cities of Rabat and Salé. The estuary of this river is termed Wadi Sala.
The river is 240 kilometres long, with a t ...
river bank.
The
cession of Larache effectively took place on 20 November 1610, when
Juan de Mendoza y Velasco, Marquis of San Germán, assumed control over the Atlantic port of
Larache on behalf of the
Hispanic Monarchy. The harbour had been promised by
Mohammed esh Sheikh el Mamun
Mohammed esh Sheikh el Mamun also spelled Muhammad al-Shaykh al-Ma'mun, (b. 1566 – d. 1613) among other transliterations; also known as Abu Abdallah Mohammed III, ar, أبو العبدالله محمد سعدي الثالث) was a member of th ...
in exchange for the Spanish support in the internal struggles of the
Saadi sultanate against his brother
Zidan Abu Maali. The place remained under Spanish control until 1689, when
it was seized by the troops of the Alaouite sultan
Ismail Ibn Sharif.
In 1612, Spanish privateers stole the
Zaydani Library, a collection of an estimated 4,000 manuscripts in literature and science belonging to Sultan
Zidan bin Ahmad of the
Saadi dynasty. These manuscripts are still kept at
El Escorial.
After a period of good bilateral relations between the Moroccan and the Spanish crowns, hostilities resumed when the emboldened Alaouite sultan
attempted to take Melilla in 1774 allied with the dey of Algiers. The failure of the siege and that of the ensuing Spanish retaliation persuaded both parties to enter peace negotiations, signing a peace treaty in 1780.
War and Spanish colonialism
The
Hispano-Moroccan War
{{Spanish-Moroccan conflicts
There have been several Hispano-Moroccan wars:
* Conquest of Melilla (1497)
* Conquest of Mehdya (1681)
* Siege of Larache (1689)
* Siege of Melilla (1774)
* Siege of Ceuta (1790-1791)
* Hispano-Moroccan War (1859–18 ...
took place in 1859 and 1860. The ''
casus belli
A (; ) is an act or an event that either provokes or is used to justify a war. A ''casus belli'' involves direct offenses or threats against the nation declaring the war, whereas a ' involves offenses or threats against its ally—usually one b ...
'' for Spain were the unrelenting attacks of
Riffian tribesmen on Spanish settlements in North Africa; following unfruitful negotiations with Sultan
Abd al-Rahman
Abd al-Rahman ( ar, عبد الرحمن, translit=ʿAbd al-Raḥmān or occasionally ; DMG ''ʿAbd ar-Raḥman''; also Abdul Rahman) is a male Arabic Muslim given name, and in modern usage, surname. It is built from the Arabic words '' Abd'', '' ...
vis-à-vis the
reparations (the latter, unable to control the tribesmen, actually died in the midst of negotiations and was replaced by his brother
Muhammad IV), a declaration of war propelled by
Leopoldo O'Donnell was unanimously passed by the Spanish
Congress of Deputies on 22 October 1859. In the
Battle of Tetuan
A battle is an occurrence of combat in warfare between opposing military units of any number or size. A war usually consists of multiple battles. In general, a battle is a military engagement that is well defined in duration, area, and force ...
, the ''
Mellah'', or Jewish quarter, of Tetuan was sacked. This was followed by appeals in the European Jewish press to support Jewish communities like the one in Tetuan, leading to an international effort called "The Morocco Relief Fund."

Following an armistice of 32 days, the
Treaty of Wad Ras or Peace of Tétouan was signed on 26 April 1860, bringing the conflict to an end. The treaty contemplated the extension on perpetuity of the Spanish presence in
Ceuta and
Melilla
Melilla ( , ; ; rif, Mřič ; ar, مليلية ) is an autonomous city of Spain located in north Africa. It lies on the eastern side of the Cape Three Forks, bordering Morocco and facing the Mediterranean Sea. It has an area of . It was par ...
, the end of tribal raids on those cities, the recognition by Morocco of Spanish sovereignty over the
Chafarinas Islands
The Chafarinas Islands ( es, Islas Chafarinas , ber, Igumamen Iceffaren, script=Latn or , ar, جزر الشفارين or ), also spelled Zafarin, Djaferin or Zafarani, are a group of three small Spanish islets located in the Alboran Sea off th ...
, the retrocession of the historical fortress of
Santa Cruz de la Mar Pequeña (a territory of uncertain location by that time) to Spain to establish a fishing post, the permission to missionaries for establishing a Christian church in Tétouan, and the Spanish administration over the latter city until massive reparations of
duros were paid.
Once Morocco paid the compensation (partially through money lent by the British), O'Donnell retired his troops from Tétouan.
After 1863, a Spanish diplomatic mission led by
Francisco Merry y Colom was sent to the court of the Moroccan Sultan in Marrakesh, with the specific goals of the rehabilitation of Muley El-Abbás, the sultan's hispanophile brother, the fostering of commercial activity in Ceuta and Melilla by means of the creation of a custom, the opening of the Port of
Agadir to Spanish ships, facilitating the meat provision to Ceuta, and the improvement on the status of Spaniards in Morocco, establishing the basis for the
peacetime commercial and diplomatic relations of Spain with the Sherifian Empire.
In the wake of the visit of a Spanish delegation to Fez in 1877, a joint Hispano-Moroccan committee was created to determine the location of the territory of Santa Cruz de la Mar Pequeña,
retroceded in the 1860 Treaty of Wad Ras. This committee eventually misidentified Santa Cruz de la Mar Pequeña with
Ifni,
actually located about 480 kilometers north of the real fortress. The Moroccan sultan accepted the identification in 1883, even if the border delimitation did not take place at the time and the effective Spanish occupation had to wait until 1934.
The
Spanish Protectorate over Morocco was established 27 November 1912 by decree of the
Treaty Between France and Spain Regarding Morocco. Relative to France, which was assigned control over most of the Moroccan State, Spain ended up with a small territory in northern Morocco, largely mountainous and not easily accessible, and to which the
Cape Juby
Cape Juby (, trans. ''Raʾs Juby'', es, link=no, Cabo Juby) is a cape on the coast of southern Morocco, near the border with Western Sahara, directly east of the Canary Islands.
Its surrounding area, including the cities of Tarfaya and Tan-T ...
strip, a small strip of land in Southern Morocco, bordering with the
Spanish Sahara added up. The city of
Tangier became an international zone.
21st-century relations
The relations deteriorated following the ascension to the Moroccan throne of
Mohammed VI in 1999. Particularly the failure to reach a deal for fisheries between the European Union and Morocco in 2001 further complicated the relations between
José María Aznar
José María Alfredo Aznar López (; born 25 February 1953) is a Spanish politician who was the prime minister of Spain from 1996 to 2004. He led the People's Party (PP), the dominant centre-right political party in Spain.
A member of the Fre ...
and Mohammed VI.
In October 2001, Morocco recalled its ambassador from
Madrid after pro-Saharan groups in Spain conducted a mock referendum on the fate of the region.
On 6 July 2002 Spanish military operations in the
Alhucemas Islands
The Alhucemas Islands ( es, Islas Alhucemas, ar, جزر الحسيمة) is a group of islands and one of the Spanish '' plazas de soberanía'' just off the Moroccan coast in the Alboran Sea.
Overview
Peñón de Alhucemas, together with ...
were perceived to be an act of aggression by Morocco.

On 11 July 2002
Perejil Island crisis erupted; members of the
Royal Moroccan Navy occupied the uninhabited
Perejil Island off the North-African coast; 6 days later Spain launched the "Operation Romeo-Sierra" and 28 members of the
Special Operations Groups of the
Spanish Army
The Spanish Army ( es, Ejército de Tierra, lit=Land Army) is the terrestrial army of the Spanish Armed Forces responsible for land-based military operations. It is one of the oldest active armies — dating back to the late 15th century.
The ...
took control of the islet evicting the 6 Moroccan cadets then present in the islet, who offered no resistance.
Diplomatic ties were not restored until January 2003. That July, Morocco complained that Spain lacked neutrality on the Sahara issue when it chaired the
United Nations Security Council and, in October, Spain suspended arms sales to Morocco due to the Perejil crisis. Spanish Prime Minister
Jose Luis Rodriguez Zapatero visited Morocco in April 2004, and King
Juan Carlos I
Juan Carlos I (;,
* ca, Joan Carles I,
* gl, Xoán Carlos I, Juan Carlos Alfonso Víctor María de Borbón y Borbón-Dos Sicilias, born 5 January 1938) is a member of the Spanish royal family who reigned as King of Spain from 22 Novem ...
visited in January 2005; on both occasions, joint statements called for a negotiated settlement to the Sahara issue—the Moroccan position.
However, visits to Ceuta and Melilla by the Spanish prime minister in January 2006 and monarchs in November 2007 again set back relations. The two neighbours also have an unresolved dispute concerning territorial waters between Morocco and the Spanish
Canary Islands
The Canary Islands (; es, Canarias, ), also known informally as the Canaries, are a Spanish autonomous community and archipelago in the Atlantic Ocean, in Macaronesia. At their closest point to the African mainland, they are west of Morocc ...
in the Atlantic Ocean. Morocco's
"super port" near
Tangier will pose competition that concerns Spanish ports. It is expected to achieve full capacity in 2014.
[Alexis Arieff]
"Morocco: Current Issues"
Congressional Research Service (30 June 2011).
Territorial disputes, despite their drama, are subordinate to the continuing and productive economic cooperation between both countries, there is also shared interests in
counterterrorism
Counterterrorism (also spelled counter-terrorism), also known as anti-terrorism, incorporates the practices, military tactics, techniques, and strategies that Government, governments, law enforcement, business, and Intelligence agency, intellig ...
,
counternarcotics, and efforts to stem illegal
immigration. Morocco notably assisted Spanish authorities in the investigation of the
2004 bombings in Madrid and this relationship continues. Moroccan soldiers have served under Spanish command in the
United Nations Stabilization Mission in Haiti and Moroccan
gendarmes have joined Spanish patrols to combat illegal immigration in the
Strait of Gibraltar
The Strait of Gibraltar ( ar, مضيق جبل طارق, Maḍīq Jabal Ṭāriq; es, Estrecho de Gibraltar, Archaic: Pillars of Hercules), also known as the Straits of Gibraltar, is a narrow strait that connects the Atlantic Ocean to the Medi ...
.
[
On 31 July-1 August 2018 Morocco indefinitely closed the Beni Ansar Customs near Melilla.
Following the breakdown of the ceasefire between the Polisario Front and Morocco, which led to armed clashes between both sides in November 2020, Spanish Second Deputy Prime Minister Pablo Iglesias tweeted the UN resolution of 1995 for the Western Sahara: "... It reiterates its commitment to hold, without further delay, a free, fair and impartial referendum for the self-determination of the people of Western Sahara ...". Unidas Podemos, minor member of the coalition government, requested the Prime Minister the same referendum to be held, clashing with the official position of the government expressed by Spanish Minister of Foreign Affairs Arancha González Laya.
On 21 December 2020, following the affirmations of the Moroccan Prime Minister, Saadeddine Othmani, stating that Ceuta and Melilla "are as Moroccan as the estern]Sahara
, photo = Sahara real color.jpg
, photo_caption = The Sahara taken by Apollo 17 astronauts, 1972
, map =
, map_image =
, location =
, country =
, country1 =
, ...
" after Trump's administration recognition of sovereignty over that territory, Spain's Secretary of State for Foreign Affairs Cristina Gallach
Cristina Gallach (born 1960) is a Spanish journalist and former European Union and United Nations official. She was the 14th Secretary of State for Foreign Affairs and for Ibero-America and the Caribbean of the Spanish government from 2020 to 2021 ...
urgently summoned the Moroccan Ambassador to Spain, Karima Benyaich, to convey that Spain expects respect from all its partners to the sovereignty and territorial integrity of its country and asked for explanations about the words of Othmani.
On 22 April 2021, Spanish officials had announced that the Polisario Front leader Brahim Ghali was sent to Spain for COVID-19 hospitalization. Morocco reacted with several reciprocal and retaliatory measures, including granting the pro-Catalan independence politician Carles Puigdemont asylum on 30 April.
On 17 May 2021, also as a response to Ghali's hospitalization in Spain, Morocco relaxed its controls over the frontier between the two countries and allowed more than five thousand Moroccan citizens and migrants (including more than 1,500 minors) to get through the Spanish city of Ceuta by passing around the jetties of Benzú and El Tarajal. This prompted the reaction of Spanish Prime Minister Pedro Sánchez, who visited Ceuta and Melilla together with the Interior Minister on 18 May.
In a cryptic manner, the Moroccan ambassador warned that "there are acts that have consequences and must be assumed" just before being recalled by the Ministry of Foreign Affairs In many countries, the Ministry of Foreign Affairs is the government department responsible for the state's diplomacy, bilateral, and multilateral relations affairs as well as for providing support for a country's citizens who are abroad. The entit ...
on 18 June, in turn shortly after she was summoned by the Spanish foreign minister. The Spanish military was deployed in the border to stop the influx. Moroccan actions were also rejected by various officials of the European Union.
European Commission Vice President Margaritis Schinas
Margaritis Schinas (Greek: Μαργαρίτης Σχοινάς; ; born 28 July 1962) is a Greek politician and former civil servant. He took office in December 2019 as a vice-president in the Von der Leyen Commission with the portfolio of Europea ...
warned that Europe would not "be intimidated by anyone on the subject of migration". The Moroccan move was described as an instance of " coercive engineered migration" and a case of grey zone operation, similarly to other asymmetrical challenges posed by Morocco underpinned by incremental and ambiguous measures below the threshold of war.
The Spanish Prime Minister Pedro Sánchez decided on 18 March 2022 to support Morocco's plan for the autonomy in the Western Sahara and said that Morocco's plan was the only way to solve the problem. This, however, was refused by the vast majority of the Spanish congress, including PSOE's partners in government. On 20 March 2022, Moroccan ambassador to Spain Karima Benyaich officially returned to Madrid.
Resident diplomatic missions
;of Morocco in Spain
* Madrid (Embassy)
* Algeciras (Consulate-General)
* Almería (Consulate-General)
* Barcelona (Consulate-General)
* Bilbao (Consulate-General)
* Girona (Consulate-General)
* Las Palmas de Gran Canaria (Consulate-General)
* Murcia (Consulate-General)
* Palma de Mallorca
Palma (; ; also known as ''Palma de Mallorca'', officially between 1983–88, 2006–08, and 2012–16) is the capital and largest city of the Autonomous communities of Spain, autonomous community of the Balearic Islands in Spain. It is situate ...
(Consulate-General)
* Seville (Consulate-General)
* Tarragona (Consulate-General)
* Valencia (Consulate-General)
;of Spain in Morocco
* Rabat
Rabat (, also , ; ar, الرِّبَاط, er-Ribât; ber, ⵕⵕⴱⴰⵟ, ṛṛbaṭ) is the capital city of Morocco and the country's seventh largest city with an urban population of approximately 580,000 (2014) and a metropolitan populati ...
(Embassy)
* Agadir (Consulate-General)
* Casablanca
Casablanca, also known in Arabic as Dar al-Bayda ( ar, الدَّار الْبَيْضَاء, al-Dār al-Bayḍāʾ, ; ber, ⴹⴹⴰⵕⵍⴱⵉⴹⴰ, ḍḍaṛlbiḍa, : "White House") is the largest city in Morocco and the country's econom ...
(Consulate-General)
* Nador (Consulate-General)
* Tanger (Consulate-General)
* Tetuan (Consulate-General)
* Larache (Consulate)
File:Embajada de Marruecos, Madrid.jpg, Embassy of Morocco in Madrid
File:MarokkoGeneralkonsulat Algeciras 20181123 10.jpg, Consulate-General of Morocco in Algeciras
File:2017 Moroccan Consulate, Barcelona 01.jpg, Consulate-General in Barcelona
File:Larache Spanish Consulate.jpg, Consulate-General of Spain in Larache
Country comparison
Common history
* Hispania
*Caliphate of Cordoba
A caliphate or khilāfah ( ar, خِلَافَة, ) is an institution or public office under the leadership of an Islamic steward with the title of caliph (; ar, خَلِيفَة , ), a person considered a political-religious successor to th ...
*Taifa of Ceuta The Taifa of Ceuta () was one of the ''taifa'' states formed after the breakup of the Caliphate of Córdoba in the early 11th century. The cities of Ceuta ( ar, Sabta, script=Latn, italic=yes) and Tangiers were a part of the Ḥammūdid dynasty '' ...
(in Ceuta and Tangier)
* Almoravid Empire
* Almohad Empire
* Benimerin Empire
See also
*Moroccans in Spain
Moroccans in Spain (; ) formed 16.4% of the 4,549,858 foreigners in Spain as of 1 January 2017. They are again the largest foreign group in Spain, after they were surpassed temporarily by Romanians in 2007. In 2003, they were estimated to make up ...
* Morocco-Spain border
* Spanish Protectorate of Morocco
* Spanish Sahara
* List of Spanish colonial wars in Morocco
References
;Informational notes
;Citations
{{DEFAULTSORT:Morocco-Spain relations
Spain
Bilateral relations of Spain
Relations of colonizer and former colony