From Moroccan-based rule of Iberia to a Portuguese fortress in the Maghreb, the two former foes share a bloody past.
After a sensational victory over Spain in the last 16, Morocco will take on Portugal in the World Cup quarter-final on Saturday.
The match against the Spanish, which the Atlas Lions won in a penalty shootout, was layered with historical and political context.
Centuries of tensions and conflict between the two countries, spanning the Islamic conquest of Andalusia, launched from Moroccan shores to 20th-century Spanish colonialism in North Africa, added an edge to the contest.
The quarter-final tie is no different: Portuguese-Moroccan relations have – for over a millennium – involved similar conflict and turbulence.
From Moroccan-based Muslim rule over Portugal to a Portuguese-built Unesco World Heritage Site in Morocco to three kings dying in the same battle between the erstwhile foes, Middle East Eye looks at the tumultuous history between the two nations.
Islamic Conquest of Portugal
In 711 CE, Tariq ibn Ziyad, an Amazigh convert to Islam who governed Tangier, crossed the Strait of Gibraltar with 7,000 soldiers and started a period of eight centuries of Muslim rule over varying parts of the Iberian peninsula.
While much of the conquered area was made up of modern-day Spain, its western neighbour, Portugal, also fell under Islamic rule.
By 718, virtually all of Portugal was controlled by Muslims, which they referred to as Gharb al-Andalus (west of Al-Andalus), or simply al-Gharb – from which the Algarve region of Portugal derives its name.
After Umayyad rule over al-Andalus collapsed in the mid-11th century, the region, including parts of Portugal, was divided into several independent Muslim principalities.
it was then that the Almoravids, followed later by the Almohads, both Amazigh dynasties with Marrakech as their capital, took over most of the Muslim-controlled territory in Iberia, including parts of southern Portugal.
But both Morocco-based empires struggled to hold off Christian advances backed by the papacy and attracted crusader knights from across Europe as part of the Reconquista.
The Kingdom of Portugal gained control of the current capital city during the Siege of Lisbon in 1147 and of the Faro region in 1249, thus bringing an end to Gharb al-Andalus.
In 1496, four years after the fall of Granada, which brought a complete end to Islamic Spain, the Kingdom of Portugal followed its Iberian neighbour by forcing its Jewish and Muslim minorities to either convert to Christianity or leave the country.
Many chose the latter option, settling in Morocco and other parts of North Africa.
Muslim rule over Portugal left a lasting cultural impact, from poetry to minaret-shaped chimneys, to 19,000 Portuguese words and expressions with Arabic origins.
The Portuguese writer Adalberto Alves was awarded the Unesco-Sharjah Prize for Arab Culture in 2008 for documenting these influences.
Portuguese occupation in Morocco
Colonialism in Morocco was initially justified on religious grounds: Portuguese kings between 1341 and 1377 received five successive papal bulls authorising crusades against Muslims in North Africa or Granada.
By 1520 the Portuguese were occupying significant parts of the Moroccan coast, including Ceuta, Tangier, Asilah, Essaouira, Agadir, Azemmour and Ksar es-Seghir.
King Afonso V conquered much of this territory in the mid-15th century and was nicknamed “the African” for his exploits across the Strait of Gibraltar.
The European occupiers built several forts across the Moroccan towns they controlled, including on the small island of Graciosa, at Castelo Real in the city of Mogador (now known as Essaouira) and Mazagan, the modern-day El Jadida.
El Jadida, 90km southwest of Casablanca, was registered as a Unesco World Heritage Site in 2004 as “an outstanding example of the interchange of influences between European and Moroccan cultures, well reflected in architecture, technology and town planning”.
It is the best-preserved Portuguese fortification in Morocco, with surviving buildings from the period, including the cistern and the Church of the Assumption.
Moroccans regain control
In the mid-16th century, Mohammed al-Shaykh, the first sultan of Morocco’s Saadian dynasty, led the pushback against the Portuguese.
Under his command, the Maghrebis expelled the Iberians from most of their fortresses along the Atlantic coast, including the key trading city of Agadir, in 1541.
At the Battle of Ksar el-Kebir in 1578, often referred to as the Battle of the Three Kings, Portugal suffered one of the worst military defeats in its colonial era.
With the help of deposed Moroccan sultan Abu Abdallah Mohammed II, King Sebastian of Portugal landed at Tangier with 20,000 men to face off against new sultan, Abd al-Malik, and his 50,000-strong forces.
The Muslim soldiers defeated the Europeans roundly, and Sebastian and Mohammed were killed during the fighting. Malik died as a result of the fighting, too, hence the name of the battle.
The death of Sebastian, who had no heir, caused a dynastic crisis in Portugal, and the kingdom was subsequently brought under Spanish control for the next 60 years. Over that period, the Portuguese empire declined internationally.
Tangier was later handed over to England in 1661 and Ceuta to Spain in 1668. The latter has been under Spanish control ever since – a point of major contention for Moroccans to this day.
The final Portuguese stronghold, Mazagan, was handed over to the Moroccans in 1769, and a peace agreement between the two countries was signed five years later.
Unlike its turbulent relationship with Spain, Morocco has no present-day territorial disputes with Portugal, and the two have maintained cordial ties over the past two and a half centuries.