This is a list of wars involving the Kingdom of Morocco and the former entities that ruled the modern polity.

Almoravid Empire (1040–1147) Conflict Combatant 1 Combatant 2 Results Head of State Moroccan losses Battle of Tabfarilla(1056) Almoravid dynasty Godala Berbers Victory Almoravid vanguard is defeated but regrouped later. Abu Bakr ibn Umar Around 300 killed Battle of Sagrajas(1086) Almoravid dynasty Taifa kingdoms Kingdom of Castile Kingdom of León Victory Decisive Christian defeat. Yusuf ibn Tashfin ~3,000 killed Battle of Aledo(1090) Almoravid dynasty Taifa kingdoms Kingdom of Castile Kingdom of Leon Defeat Castilian-Leonese victory. Unknown Battle of Consuegra(1097) Almoravid dynasty Kingdom of Castile Kingdom of León Victory Castilian forces routed. Hundreds killed Battle of Uclés(1108) Almoravid dynasty Kingdom of Castile Kingdom of Leon Victory Death of Infante Sancho Alfónsez. Ali ibn Yusuf Around 1,000–2,000 killed Siege of Marrakesh(1147) Almoravid dynasty Almohad dynasty Defeat Almohad victory.* End of Almoravid rule. Ishaq ibn Ali Entire garrison & rulers executed

Almohad Caliphate (1121–1269) Conflict Combatant 1 Combatant 2 Results Head of State Moroccan losses Siege of Seville(1147) Almohad dynasty Almoravid dynasty Victory Seville captured by Almohads. Abd al-Mu'min Unknown Siege of Mahdia(1160) Almohad dynasty Kingdom of Sicily *(Normans)* Victory Normans expelled from Mahdia. Unknown Battle of Alarcos(1195) Almohad dynasty Kingdom of Castile Victory Complete route of Christian forces. Abu Yaqub Yusuf Around 4,000–5,000 killed Battle of Las Navas de Tolosa(1212) Almohad dynasty Kingdom of Castile Kingdom of Aragon Kingdom of Navarre Kingdom of Portugal Defeat Christian coalition victory. Muhammad al-Nasir ~20,000 to 50,000 killed Fall of Marrakesh(1269) Almohad dynasty Marinid Sultanate Defeat Marinid victory.* End of Almohad rule. Idris al-Wathiq Dynasty ended

Marinid Sultanate (1244–1465) Conflict Combatant 1 Combatant 2 Results Head of State MoroccanlossesBattle of Salé (1260) Marinid Sultanate Kingdom of CastileVictory Castile is expelled from Salé.Abu Yusuf Yaqub ibn Abd Al-Haqq Several killed3,000 captured and taken as slaves in SevilleMrini, Driss; Alaoui, Ismaïl (1997). Salé: Cité Millénaire (in French). Editions Eclat, Rabat. pp. 45–46.Zayyanid Capture of Sijilmasa (1264)Marinid SultanateZayyanid KingdomDefeat Zayyanid victory.Battle of Écija (1275) Marinid Sultanate Emirate of Granada Kingdom of CastileVictory Decapitation of Nuño González de Lara. UnknownBattle of Martos (1275)Marinid Sultanate Emirate of Granada Kingdom of CastileVictory Capture and murder of Sancho of Aragon. UnknownBattle of Algeciras (1278)Marinid Sultanate Emirate of Granada Kingdom of Castile Order of Santa María de EspañaVictory Destruction of the entire Castilian fleet. UnknownSiege of Algeciras (1278–1279)Marinid Sultanate Kingdom of CastileVictory Destruction of the entire Castilian fleet. Alfonso X of Castile signs a new truce in 1279. UnknownSiege of Tlemcen (1299–1307)Marinid SultanateZayyanid KingdomDefeat The Marinids abandons the siege.Abu Yaqub Yusuf an-Nasr UnknownThird Siege of Gibraltar (Feb.–Jun. 1333)Marinid Sultanate Kingdom of CastileVictory Conquest of Gibraltar by the Marinids. Abu al-Hasan Ali UnknownFourth Siege of Gibraltar (Jun.–Aug. 1333)Marinid Sultanate Kingdom of CastileVictory The Marinids retain control of Gibraltar. Castilian siege lifted. UnknownSiege of Tlemcen (1335–1337)Marinid SultanateZayyanid KingdomVictory The Marinids annexe the Kingdom of Tlemcen. UnknownBattle of Vega de Pagana (1339)Marinid Sultanate Emirate of Granada Crown of CastileDefeat Death of Abu Malik. UnknownBattle of Río Salado (1340)Marinid Sultanate Emirate of Granada Crown of Castile Kingdom of PortugalDefeat The Marinid invasion decisively repelled. UnknownBattle of Estepona (1342)Marinid Sultanate Crown of AragonDefeat Rout of the Marinid fleet. 4 galleys captured2 ships destroyedSiege of Algeciras (1342–1344)Marinid Sultanate Emirate of Granada Crown of Castile Republic of Genoa Kingdom of Aragon Kingdom of Portugal Kingdom of Navarre CrusadersDefeat Conquest of Algeciras by Castile. UnknownFifth Siege of Gibraltar (1349–1350)Marinid Sultanate Emirate of Granada Kingdom of CastileVictory Castilian withdrawal.Abu Inan Faris UnknownSixth Siege of Gibraltar (1411)Marinid Sultanate Emirate of GranadaDefeat Granada retains control of Gibraltar.Abu Said Uthman III UnknownConquest of Ceuta (1415)Marinid Sultanate Kingdom of PortugalDefeat Conquest of Ceuta by Portugal. Several thousands killed or taken prisoners

1 cannon capturedChase, p. 109Siege of Ceuta (1419)Marinid Sultanate Emirate of Granada Portuguese EmpireDefeat Portugal retains control of Ceuta. Unknown Battle of Tangier (1437)Marinid Sultanate Portuguese Empire Victory Marinid victory Capture of Ferdinand the Holy Prince.Abd al-Haqq II Unknown

Wattasid Sultanate (1472–1554) Conflict Combatant 1 Combatant 2 Results Head of State MoroccanlossesConquest of Asilah (1471)Wattasid Sultanate Portuguese EmpireDefeat Conquest of Asilah and Tangier by Portugal.Muhammad ibn Yahya al-Sheikh 2,000 killed5,000 captured Conquest of Melilla (1497)Wattasid Sultanate Castile–Aragon Union Defeat Conquest of Melilla by Spain. UnknownBattle of Azemmour (1513)Wattasid Sultanate Portuguese EmpireDefeat Conquest of Azemmour by Portugal.Muhammad al-Burtuqali 1,500 infantry killed1000 cavalry killed7 ships destroyedBattle of Mamora (1515)Wattasid Sultanate Portuguese EmpireVictory Portugal abandons its fort in Mamora (Mehdya). Unknown

Saadi Sultanate (1510–1659) Conflict Combatant 1 Combatant 2 Results Head of State MoroccanlossesFall of Agadir (1541)Saadi Sultanate Portuguese EmpireVictory Morocco annexes Agadir. Portugal evacuates Azemmour and Safi.Mohammed al-Shaykh UnknownCampaign of Tlemcen (1551)Saadi Sultanate Spanish Empire Ottoman Empire Beylerbeylik of Algiers Kingdom of Aït AbbasZayyanid KingdomDefeat Algiers captures Tlemcen. The Moulouya River is imposed as the border. UnknownBattle of Taza (1553)Saadi SultanateRegency of AlgiersDefeat Algerian captured and garrisoned TazaCapture of Fez (1554)Saadi Sultanate Ottoman Empire Beylerbeylik of Algiers Kingdom of KukuWattasid SultanatePrincipality of DebdouDefeat The Ottomans occupy Fez for four months. Ali Abu Hassun rules Fez as an Ottoman vassal. UnknownBattle of Tadla (1554)Saadi SultanateWattasid SultanateVictory The Saadi dynasty becomes the undisputed ruler of Morocco. Death of Ali Abu Hassun and end of the Wattasid dynasty. Fez is no longer an Ottoman vassal. UnknownCampaign of Tlemcen (1557)Saadi Sultanate Beylerbeylik of AlgiersKingdom of Aït AbbasDefeat Assassination of Mohammed al-Shaykh under the commands of Hasan Pasha. UnknownBattle of Wadi al-Laban (1558)Saadi Sultanate Beylerbeylik of AlgiersInconclusiveAbdallah al-Ghalib UnknownSiege of Mazagan (1562)Saadi Sultanate Portuguese EmpireDefeat Portugal retains control of Mazagan (El Jadida). UnknownRebellion of the Alpujarras (1568–1571) Muslims of GranadaSupport:Saadi Sultanate Beylerbeylik of Algiers Spanish EmpireDefeat Mass expulsion of most Muslims in Granada. Resettlement of Granada with Catholic settlers. UnknownCapture of Fez (1576)Saadi Sultanate Muhammad Abu Abdallah ForcesSaadi Sultanate Abd al-Malik Forces Ottoman Empire Beylerbeylik of AlgiersAbd al-Malik Forces Victory Ottoman Forces conquer Fez then Marrakesh. Abd al-Malik assumes rule over Morocco as an Ottoman vassal.Abdallah Mohammed UnknownBattle of Alcácer Quibir (1578)Saadi Sultanate Portuguese EmpireVictory Death of Abd al-Malik, Abdallah Mohammed and Sebastian of Portugal. 1580 Portuguese succession crisis.Abd al-Malik I7,000 dead (Portuguese source) 1,500 dead

(Spanish source) Battle of Tondibi (1591) Saadi Sultanate Songhai Empire Victory Collapse of the Songhai Empire. Formation of the Pashalik of Timbuktu.Ahmad al-Mansur UnknownBattle of Jenné (1599)Saadi Sultanate TimbuktuMali EmpireVictory Collapse of the Mali Empire. UnknownSuccession War (1603–1627)Saadi Sultanate Marrakesh ForcesSaadi Sultanate Fez ForcesMarrakesh Forces Victory Morocco is reunified under the rule of Abd al-Malik II.Abd al-Malik II Unknown

Alaouite Sultanate (1668–1912) Conflict Combatant 1 Combatant 2 Results Head of State MoroccanlossesSiege of Tangier (1680) Alaouite Sultanate Kingdom of England TangierDefeatIsmail Ibn Sharif Siege of Mehdya (1681) Alaouite Sultanate Spanish EmpireVictory Morocco recaptures Mehdya. Unknown Siege of Larache (1689) Alaouite Sultanate Spanish EmpireVictory Morocco annexes Larache. Unknown Siege of Asilah (1691) Alaouite Sultanate Spanish EmpireVictory Morocco annexes Asilah.Ogot, Bethwell (1998). International Scientific Committee for the drafting of a General History of Africa, p. 176 UnknownBattle of Moulouya (1692) Alaouite Sultanate Deylik of AlgiersDefeat The Moulouya River is imposed as the border.5,000 killedSiege of Oran (1693) Alaouite Sultanate Spanish Empire Deylik of AlgiersDefeat Rout of the Moroccan troops. UnknownSieges of Ceuta (1694–1727) Alaouite SultanateSupport: Kingdom of England (Until 1707) Great Britain (From 1707) Spanish EmpireWithdrawal Moroccan retreat following the death of Moulay Ismail. Spain retains control of Ceuta. UnknownMaghrebi War (1699–1702) Beylik of Tunis Alaouite Sultanate Pashalik of Tripoli (Until 1700) Deylik of Algiers Pashalik of Tripoli (From 1700)Stalemate Algiers' ambitions halted Morocco fails to expand. Fall of the Muradid dynasty in Tunis. Civil war in Tripoli. 3,050 killed (Battle of Chelif)Laghouat Expedition (1708–1713) Alaouite SultanateLaghouatAïn MadhiAïn SéfraBoussemghounVictory The oases around Laghouat become tributaries of Morocco. UnknownLarache Expedition (1765) Alaouite Sultanate Kingdom of FranceVictory Rout of the French fleet. Signing of a truce and a treaty in 1767.Mohammed III30 killedSiege of Mazagan (1769) Alaouite Sultanate Kingdom of PortugalVictory Morocco recaptures Mazagan. Unknown Siege of Melilla (1774–1775) Alaouite SultanateSupport: Great Britain Kingdom of Spain Defeat Treaty of Aranjuez. Morocco recognises Spanish rule of Melilla. Spain cedes territories to Morocco. 600 dead or woundedDutch-Moroccan War (1775–1777) Alaouite Sultanate Dutch RepublicDefeat Release of all Dutch slaves. Freeing of the Dutch Republic from paying tributes and sending gifts to Morocco. Several ships destroyed and capturedCapture of the Rif (1792) Alaouite Sultanate Deylik of AlgiersDefeat Conquest of the eastern Rif region by Algiers.Slimane ben Mohammed UnknownFirst Barbary War (1802–1804) Pashalik of Tripoli Alaouite Sultanate United States Sweden (1802) SicilyInconclusive Peace treaty.NoneCampaign of Azrou and Sefrou (1811-1812) Alaouite SultanateZayanesDefeatUnknownBattle of Zayan (1818) Alaouite SultanateBerber coalitionDefeatUnknownFrench conquest of Algeria (1830–1844) Deylik of Algiers Emirate of MascaraSupport: Alaouite Sultanate France French AlgeriaDefeat France pacifies resistance forces. Franco-Moroccan War.Abd al-Rahman ben Hisham Unknown Franco-Moroccan War (1844) Alaouite Sultanate France French Algeria Defeat Treaty of Tangier. Morocco recognises Algeria as part of the French Empire. Treaty of Lalla Maghnia. France annexes El Bayadh, Chellala, Boussemghoun and Tiout.870 killed28 cannons lostBombardment of Salé (1851) Alaouite Sultanate FranceInconclusive Moroccan political victory. French military victory.24 killed47 injuredBattle of Tres Forcas (1856) Alaouite Sultanate PrussiaVictory Prussian withdrawal. Adalbert of Prussia and Eduard von Knorr wounded. Unknown Hispano-Moroccan War (1859–1860) Alaouite Sultanate Spain Defeat Treaty of Wad Ras. Morocco recognises Spanish rule of Ceuta and Melilla. Retrocession of Santa Cruz de la Mar Pequeña.