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.