Moroccan–Portuguese conflicts

Moroccan–Portuguese conflicts refer to a series of battles between Morocco and Portugal throughout history including Battle of Tangier, Fall of Agadir and other battles and sieges in the Moroccan coast.

The first military conflict, in 21 August 1415, took the form of a surprise assault on Ceuta by 45,000 Portuguese soldiers who traveled on 200 ships. It was later followed by the Siege of Ceuta in 1419. These events marked the beginning of the decline of the Marinid Sultanate and the start of the Portuguese Empire.

The major battle, Battle of Alcácer Quibir, fought at Ksar-el-Kebir on 4 August 1578, was a catalyst for the 1580 Portuguese succession crisis. This resulted in a dynastic union between the Kingdom of Portugal and the Kingdom of Spain.

The conflicts ended when Portugal lost Mazagan (El Jadida) in 1769 to the 'Alawite Sultan Mohammed ben Abdallah.

Portuguese expansion (1415–1515)
Portugal started to occupy parts of coastal Morocco in 1415 with the Conquest of Ceuta, which was besieged unsuccessfully three years later by the Moroccans. Then under Afonso V of Portugal, Portugal conquered Alcácer-Ceguer in 1458, Arzila in 1471 and Tangier, which was won and lost several times between 1460 and 1464. These achievements earned the King the nickname of the African.

Portugal and Spain had passed an agreement in 1496 in which they effectively established their zones of influence on the North African coast: Spain could only occupy territory east of Peñón de Vélez de la Gomera. This restriction would only end with the dynastic union of the Portuguese and Spanish crowns under Philip II after the 1578 Battle of Alcácer Quibir, when Spain began to take direct action in Morocco, as in the occupation of Larache in 1610.

Altogether, the Portuguese are documented to have seized six Moroccan cities and built six stand-alone fortresses on the Moroccan Atlantic coast, between the Loukkos River in the north and the Sous River in the south.

The six cities were: Ceuta (1415–1668), Alcácer-Ceguer (1458–1549), Tangier (1471–1661), Arzila (1471–1550), Safi (1488–1541) and Azamor (1513–1541).

Moroccan reconquest (1541–1769)
Of the six stand-alone fortresses, four only had a short duration: Graciosa (1489), São João da Mamora (1515), Castelo Real of Mogador (1506–10) and Aguz (1520–25). Two of them became permanent urban settlements: Santa Cruz do Cabo de Gué (Agadir) founded in 1505–06 and Mazagan (El Jadida) founded in 1514–17.

The Portuguese had to abandon most of their settlements between 1541 and 1550 (Safi and Azamor in 1541, Alcácer-Ceguer in 1549, and Arzila in 1550) following the offensives of the Saadi Sultan Mohammed ash-Sheikh, particularly the Fall of Agadir in 1541 and the Capture of Fez in 1549. Nevertheless, they were able to keep the bases of Ceuta, Tangier and Mazagan.

The Battle of Alcácer Quibir in 1578 was a landslide loss, as the Portuguese King Sebastian was killed in the encounter and saw his army eliminated by Moroccan forces.

Tangier was ceded to King Charles II in 1661 to encourage England to support Portugal in the Portuguese Restoration War, and Ceuta was handed over to Spain in 1668 through the Treaty of Lisbon, which recognized the House of Braganza as Portugal's new ruling dynasty and its rule over Portugal's remaining overseas colonies. These events essentially ended Portugal's direct involvement in Morocco. The Portuguese evacuated Mazagan in 1769, their last base, under the pressure from the 'Alawite Sultan Mohammed ben Abdallah.

Aftermath
Five years after the recapture of Mazagan, in 1774, the Governments of Morocco and Portugal concluded a Peace and Friendship Agreement, one of the oldest bilateral agreements of both nations.