The ruler of Tlemcen, Ibn Tashufin (r. 1318-1337), initiated hostilities against Ifriqiya, besieged Béjaïa, and sent an army into Tunisia that defeated the Hafsid king Abu Yahya Abu Bakr II, who fled to Constantine while the Zayyanids occupied Tunis.
Muhammad I al-Mustansir (r. 1249-1277), Hafsid ruler of North Africa and self-declared Caliph
Rashid revolted in Mazuna and defeated Umar ben Waghram, ruling the Maghrawa 1302-1310, allied to Hafsid dynasty of Bugia (Bidjaya) after 1307.
Ibn Tashufin besieged Béjaïa, and sent an army into Tunisia that defeated the Hafsid king Abu Yahya Abu Bakr II, who fled to Constantine while the Zayyanids occupied Tunis.
From its capital at Tunis, the Hafsid dynasty made good its claim to be the legitimate successor of the Almohads in Ifriqiya, while, in the central Maghrib, the Zayyanids founded a dynasty that ruled the Kingdom of Tlemcen.