He was the Almohad governor of Gabès and then of Tunis by 1229. He seized the opportunity offered by disturbances in the Almohad Empire to declare himself independent late in 1229. He subsequently captured Constantine and Bougie in 1230 and annexed Tripolitania in 1234, Algiers in 1235 and subdued important tribal confederations of the Berbers from 1235 to 1238.
In 1242 he captured Tlemcen, forcing the Sultan of Tlemcen to become his vassal. In the December of that year, caliph Abd al-Wahid II, died, leaving Abu Zakariya as the most powerful ruler of Maghreb. By the end of his reign, the Marinid Dynasty of Morocco and several Muslim princes in Al-Andalus paid him tribute and acknowledged his nominal authority. A skillful general, his ability to utilize the military power of the tribesmen enabled him to establish a strong state. His Hafsid dynasty brought peace, prosperity, and stability to Tunisia.
- Julien, Charles-André. Histoire de l'Afrique du Nord, des origines à 1830, Payot, Paris, 1994.
Muhammad I al-Mustansir