Abu Zakariya Yahya I was the founder of the Hafsid dynasty as an independent sovereign state and the first ruler to govern Ifriqiya from Tunis as capital after the long Almohad period. He was born around 1203 into the Hafsid lineage of the Almohad governing class — descendants of Abu Hafs Umar ibn Yahya al-Hintati, one of the original ten Masmuda Berber companions of Ibn Tumart at Tinmel and a principal organiser of the early Almohad state.
He served as Almohad governor of Ifriqiya from 1226, appointed by his cousin the caliph al-Ma'mun, and from 1228 ruled with substantial autonomy as the Almohad central authority disintegrated under the cumulative pressure of the Marinid rise in the western Maghreb and the loss of al-Andalus after Las Navas de Tolosa. In 1229 he formally renounced the Almohad caliphate and proclaimed himself sovereign in Tunis, founding the Hafsid dynasty as an independent state.
His reign of twenty years consolidated Hafsid authority across Ifriqiya — the modern Tunisia, eastern Algeria, and Tripolitania — and reorganised the Tunisian state apparatus along lines that would persist through the Hafsid period to the Ottoman conquest of 1574. He patronised the substantial Andalusi-refugee scholar community arriving from the post-Las-Navas Iberian peninsula, including the Sufi Abu al-Hasan al-Shadhili, whose teaching at Tunis was conducted under Abu Zakariya's protection from the late 1230s.
Diplomatically, he extended Hafsid authority to nominal recognition by the Marinid sultans of Morocco, the Aragonese crown of the western Mediterranean, and the Holy Roman Emperor Frederick II of Sicily. He died at Bône (modern Annaba) in 1249 and was succeeded by his son al-Mustansir I, under whom the Hafsid state reached its most extensive form across the second half of the thirteenth century.