Maghrebi war (1699–1702)

The Maghrebi war (1699-1702) was a conflict involving a Tunisian, Tripolitanian, and Moroccan coalition, and the Deylik of Algiers. It was an important milestone in the further weakening of the already fragile Ottoman grip over the Maghreb, as both sides utterly ignored the Ottoman sultan's pleas to sign a peace treaty.[2] This war also led to the renewal of the Muradid infighting, which would later lead to the establishment of the Beylik of Tunis, and the Husainid dynasty in 1705.[3]

Maghrebi war
Part of the Algerian-Sherifian conflicts, and the Tunisian–Algerian Wars

Algerian victory[1]

  • Moroccan and Tunisian forces routed[1]
Very minor, or no changes
Flag of Ottoman Algiers.svg Deylik of Algiers Tunisian flag till 1831.svg Beylik of Tunis
Flag of Morocco 1666 1915.svg Sultanate of Morocco
Flag of Tripoli 18th century.svg Pashalik of Tripoli
Commanders and leaders
Flag of Ottoman Algiers.svg Hadj Mustapha
Flag of Ottoman Algiers.svg Hassan Chaouch
Flag of Ottoman Algiers.svg Bouchelaghem Bey
Flag of Ottoman Algiers.svg Ali Khodja Bey (KIA)
Flag of Ottoman Algiers.svg Ahmed ben Ferhat
Tunisian flag till 1831.svg Mourad III
Tunisian flag till 1831.svg Ibrahim Sharif
Flag of Morocco 1666 1915.svg Moulay Ismail
Flag of Morocco 1666 1915.svg Zeïdan ben Ismail
Flag of Tripoli 18th century.svg Bosnak Ismail Pasha



As early as the 1690s, a change of course was made in the foreign policy of the Regency of Algiers by the dey Hadj Chaabane whom diverted Algiers from the wars of sea against the Europeans and sought to federate the entire Maghreb under his authority. He specifically was interested in expanding his borders by enlarging the Beylik of Mascara.[4] He also wanted to annex Tunis, and make it a fourth Beylik-governorate.

During this time the freshly rising Alaouite dynasty also sought to expand their control, and especially fancied the Beylik of Mascara, an Algerian governorate in the west of the country.

Algerian-Moroccan conflictsEdit

During his early reign, Alaouite sultan Ismail Ibn Sharif directed several unsuccessful invasions to take over the Beylik of Mascara which all resulted in defeats in 1672 at Tlemcen, 1678 at the Oued Za, 1692 at the Moulouya, 1693 in Oran and 1694 in Djidiouïa.[5][1]

The Battle of Moulouya, in 1692 ended in an Algerian victory, and the Algerians pushing the Moroccans back all the way to Fez.[6]

The Siege of Oran was an attempt by the Moroccans to seize Spanish Oran and the Algerian territories around them. The allied Spanish-Algerian armies successfully pushed the Moroccans back.

In the resulting peace treaty the Sultan of Morocco was forced to give up every territory east of the Moulouya River.[7]

Algerian-Tunisian warEdit

In 1694 Chabane invaded Tunisia with the help of a pretender called Mohammed ben Cheker.[8] The resulting war ended in the total annexation of Tunis for several months. During that time Chaabane appointed ben Cheker as the Bey of Tunis, a new Beylik of Algiers similarly functioning in the same way as the Beylik of Constantine.

This didn't last long though, and in 1695 the Tunisians revolted and defeated ben Cheker at the battle of Kairouan, reinstating the Muradid dynasty. This ended the short-lived Algerian Beylik of Tunis.

Tunisian-Moroccan allianceEdit

After these defeats the two countries of Tunis and Morocco decided to ally against the Algerians, whom recently experienced instability following a revolt by the Odjak of Algiers against the Corsair-friendly Hadj Chaabane.[9] The two countries decided to prepare for a coordinated invasion of Algiers.

The warEdit

Moroccan invasion of the Beylik of MascaraEdit

In the Hijri year of 1111 (1699-1700) the Moroccan army, mainly composed of the Black Guard, led by the son of Ismail, Zeidan or Zidan entered Algeria.[10] As the Bey of Mascara, Mustapha Bouchelaghem was at the time not prepared to defend his territory, the invasion was swift. The first engagement was at Tlemcen wherein the Moroccan army besieged the city defended by armed Kouloughlis whom were the main inhabitants of the city.[11] After it fell, the Moroccan army went on and advanced to Mascara, the capital of the Beylik where he looted the palace of the Bey, despite his initial success this campaign resulted in a peace negotiation which infuriated Moulay Ismail and caused him to direct another offensive against the Algerians.[12][13] These achievements by Moulay Zidan are apparently unknown to contemporary comment and may be assumed to be fiction, however during the same year a Moroccan prince was defeated by an Algerian battalion in September while he was on a minor tax raid in Tlemcen.[14]

Tunisian campaign on ConstantineEdit

In 1699 Tunisian troops reinforced with Tripolitanian ones invaded the Beylik of Constantine, at the same time as the Moroccan ones. The Bey of Constantine at the time, Ali Khodja Bey was more prepared than his Mascaran counterpart, although he failed decisively in a battle near Constantine against Murad III Bey, and his commander Ibrahim Sharif of Tunis.[13][8] Although his goal was not necessarily clear, he most likely wanted to incorporate Kabylia and Constantinois into Tunisia in a similar fashion to the Hafsid dynasty.

Moroccan retreatEdit

After several raids against him, Zidan chose to retreat from captured Algerian territories, keeping his loot with him. This retreat angered his father whom promptly replaced him.

Algerian counter-attackEdit

Battle of Jouami' al' UlamaEdit

On 3 October 1700 Algerian forces successfully defeated the armies of Murad in the Battle of Jouami' al' Ulama near Sétif.[15] This defeat cause a rout, and Murad had to retreat back into Tunisian territories, abandoning all of his gains. Although he did lose, he attempted to raise another army in hopes of attacking Algeria again. He also sent his commander Ibrahim Sharif to Constantinople to recruit additional janissaries.[2]

Battle of ChélifEdit

Ismail led a large army of up to 50,000 men[16] against the armies of the Dey of Algiers. Despite the numerical inferiority of the Algerians, they were still able to achieve a great victory over the Moroccan armies, killing about 3,000 Moroccans.[17] This defeat led a to a Ceasefire between Algiers and Morocco, and allowed the Dey to focus on Tunis instead.

Assassination of Murad III, end of the warEdit

In 1702, Murad III was raising an army to start another offensive into Algeria. Ibrahim Sharif returned from Constantinople with a large amount of Turkish janissaries which pleased Murad, although unknown to him, Sharif had specific plans. Acting on secret orders from the Ottoman Sultan, on 2 June he assassinated Murad and killed his entire family, and restored Ottoman control over the territory, and ending the Muradid dynasty.[18][19] He signed a peace treaty with the Algerians a few weeks later, ending the war with a Status quo ante bellum.


Although the wars had no short-term effects other than destruction, its long-term effects were more important. In 1705, as a direct result of this war, another war broke out between Algiers and Tunis, which led to the establishment of the Husainid dynasty.[20][21]

After Hadj Mustapha lost popularity an Algiers as a result of these wars he was killed in 1705, and after his death, the country fell into chaos, as Deys were often killed within days or sometimes hours of being elected. It wasn't until 1710 that Algiers was stabilized by a new Dey called Baba Ali Chaouch.[22]

These, and further military defeats of Tripolitania would lead to instability, and the ascension of the Karamanli dynasty in 1711.[23]

Morocco was the least touched in these conflicts although they had to give up their claims over western Algeria, and for some time Oujda.


  1. ^ a b c Gheziel, Abla. "La politique des deys d'Alger à la veille de la conquête française (1730-1830)." Al-Mawaqif (Revue des études et des recherches sur la société et l'histoire) 6 (2011): 63-74. p.1. “1672, Moulay Ismā'il lance une expédition, espérant conquérir Tlemcen: il est battu. En 1702, le Maroc et Tunis s'associent en une expédition militaire commune contre Alger, Mustapha les affronte et les met en déroute“
  2. ^ a b André Raymond, Tunis sous les Mouradites : la ville et ses habitants au XVIIe siècle, éd. Cérès, Tunis, 2006
  3. ^ Ibn Abi Dhiaf 1990, p. 107.
  4. ^ Grammont, H. D. de (1887). Histoire d'Alger sous la domination turque (1515-1830) (in French). E. Leroux.
  5. ^ Les confins algéro-marocains Augustin Bernard É. Larose
  6. ^ Galibert, Léon (1844). L'Algérie: ancienne et moderne depuis les premiers éstablissements des Carthaginois jusqu'à la prise de la Smalah d'Abd-el-Kader (in French). Furne.
  7. ^ Martinière, Maximilien Antoine Cyprien Henri Poisson de La; Lacroix, Napoléon (1894). Documents pour servir à l'étude du Nord Ouest africain: réunis et rédigés par ordre de M. Jules Cambon (in French). Gouvernement général de l'Algérie, Service des affaires indigènes.
  8. ^ a b Rousseau, Alphonse (1864). Annales tunisiennes: ou, Aperçu historique sur la régence de Tunis (in French). Bastide.
  9. ^ "Les Deys 2". Retrieved 2021-05-10.
  10. ^ Garrot, Henri (1910). Histoire générale de l'Algérie (in French). Impr. P. Crescenzo.
  11. ^ Kettle, Michael (1993). De Gaulle and Algeria, 1940-1960: From Mers El-Kébir to the Algiers Barracades [sic.]. Quartet. ISBN 978-0-7043-7023-4.
  12. ^ Histoire générale de l'Algérie. P.554. Henri Garrot Impr. P. Crescenzo,
  13. ^ a b Cour Auguste, « Chapitre X », L’établissement des dynasties des Chérifs au Maroc et leur rivalité avec les Turcs de la Régence d’Alger, Saint-Denis, Éditions Bouchène, « Histoire du Maghreb », 2004, p. 150-155.
  14. ^ Mercer, Patricia Ann. Political and military developments within Morocco during the early Alawi Period (1659-1727). University of London, School of Oriental and African Studies (United Kingdom), 1974
  15. ^ Mahfoud Kaddache, , Alger, EDIF2000, 2011 (1re éd. 1982) p. 419
  16. ^ Galibert, Léon (1846). L Algérie ancienne et moderne: depuis les temps les plus reculés jusqu'à nos jours comprenant le bombardement de Tanger, la prise de Mogador, la bataille d'Isly et le glorieux combat de Djemma-Gazouat (in French). Furne et Cie.
  17. ^ Turbet-Delof, Guy (1973). La presse périodique française et l'Afrique barbaresque au XVIIe [dix-septième] siècle: 1611-1715 (in French). Librairie Droz. ISBN 978-2-600-03532-3.
  18. ^ Ibn Abi Dhiaf, op. cit., p. 95
  19. ^ Andreas Tunger-Zanetti, , Paris, L'Harmattan, coll. « Histoire et perspectives méditerranéennes », 1996, 300 p.
  20. ^ The Making of the Modern Mediterranean: Views from the South. Univ of California Press. 2019-07-09. ISBN 978-0-520-30460-4.
  21. ^ Tunisia, the Rough Guide. Rough Guides. 1998. ISBN 978-1-85828-336-4.
  22. ^ The St. James's Magazine and United Empire Review. A.H. Moxon. 1875.
  23. ^ Habib, Henry (1975). Politics and Government of Revolutionary Libya. Cercle du livre de France. ISBN 978-0-7753-6010-3.