After the split of the Hafsids from the Almohads under Abu Zakariya (1229–1249), Abu Zakariya organised the administration in Ifriqiya (the Roman province of Africa in modern Maghreb; today's Tunisia, eastern Algeria and western Libya) and built Tunis up as the economic and cultural centre of the empire.
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.