Draft:Almoravid-Hammadid War

The Campaign of Tlemcen was a 21 year long succesful War from the Hammadids to retrieve their previous lands from the Almoravides.

Background
In 1080-1082, Yusuf Ibn Tashfin, the Almoravid emir, launched an assault on the western territories of the Hammadid states controlled by the Maghraouas More precisely, according to Ibn Khaldun, two Zanata tribes from the west become auxiliaries of the Sanhaja from the time of Bologhine Ibn Ziri: the Beni Wemanu and the Beni Ilomi. The Beni Wemanu, through their leader Makhokh, renew the agreement with the Hammadid sovereign through a matrimonial alliance. Sultan Hammadid, al Mansur, married the sister of Makhokh in order to seal an alliance with the Zenata of the West. Yusuf Ibn Tashfin pushes his successes even further: he captures Tlemcen from the Beni Yala, and takes control of Oran, Ténès, the Ouarsenis, Chélif up to Algiers in 1082. He returns to Marrakech the following year. In Tlemcen, he installs a governor named Mohamed Ibn Tinamur, who receives support from the local tribe of the Beni Wemanou and therefore their leader Makhokh. The intrigues of the governor of Tlemcen eventually lead this tribe to adopt a hostile attitude towards the Hammadids.

Battle of Tlemcen (1082)
Soon after, at an uncertain date, Sultan Hammadid Al Mansur marches against Tlemcen. He suffers an initial defeat; Makhoukh intensifies his efforts against his brother-in-law by offering full support from his tribe to the Almoravids. However, the Hammadids devastate the region and several strongholds of Makhoukh, threatening the army of the Almoravid governor Mohamed Ibn Tinamur. Yusuf Ibn Tashfin is forced to request a truce, retaining Tlemcen but without planning further attacks against the rest of the Hammadid territories However, the Almoravid attacks resume, and the Hammadid Al Mansour sends his son, Emir Abdallah, to regain the Sanhaja territories, while the defeated Almoravids retreat to present-day Morocco. Emir Abdallah then seizes the possessions of the Beni Wemanu tribe: the cities of Djebat and Merat are captured, and he takes many captives. According to Mouloud Gaid, Emir Abdallah then succeeds in capturing Tlemcen.

Battle of Achir/Battle of Tlemcen (1103)
Makhokh launches an attack against Achir, the ancestral city of the Zirids. Sultan Hammadid Al Mansour calls upon all Sanhaja and Hilalian tribes to avenge the insult. A Hammadid coalition including Hilalian Arabs gathers an army of 20,000 men, marching against Tlemcen in 1102/1103. Tachfin Ben Tinemer is completely defeated, and his wife Houa appeals to Al Mansour, invoking the bonds between the two Sanhaja nations to avoid the sacking of the city. Victorious, Al Mansour returns to Béjaïa after a detour in the Zab to pacify the region. He dies 3 years later in 1105.