Ali ibn Yusuf
In the years 1126, 1127 and again in 1130, the city saw a number of battles between the Almoravid sultan Ali ibn Yusuf and the Almohad army led by Ibn Tumart and Abd al-Mu'min. Following a general rout of Almoravid forces throughout Morocco and Algeria, Abd al-Mu'min entered Aghmāt without a fight on the middle day of Muharram 541 (27 June 1146).