The Hafsids (Arabic: الحفصيون al-Ḥafṣiyūn) were a Sunni Muslim dynasty of Berber descent[1] who ruled Ifriqiya (modern day Tunisia, western Libya, and eastern Algeria) from 1229 to 1574.
The caliph had granted him a significant degree of autonomy in governing, partly to help persuade him to accept this difficult position in the first place.
He appointed some of them to important political positions and recruited Andalusi military regiments as a way of counteracting the power and influence of traditional Almohad elites.
[8] For a time, the Nasrid ruler of Granada in al-Andalus, Ibn al-Ahmar, briefly acknowledged Abu Zakariya's suzerainty in an attempt to enlist his help against Christian forces.
[7]: 119–120 Abu Zakariya showed more interest in trying to recreate some of the former authority of the Almohads over the Maghreb and he made attempts to extend his control further west.
The two leaders eventually came to an agreement, with Yaghmurasan continuing to rule in Tlemcen but agreeing to formally recognize Abu Zakariya's authority.
[7]: 120–121 In the western Maghreb (present-day Morocco), the Marinids, who had not yet fully established their rule in the region, formally recognized his authority in 1258.
[7]: 120 With the fall of Baghdad, the home of the Abbasid caliphs, that same year, the Hafsids were briefly seen as the most important rulers of the Muslim world.
This division continued to characterize Hafsid politics for much of its history, with the balance of power sometimes shifting from one side to another and with intermittent successes at unifying both branches under one rule.
[7]: 111, 128 Abu Inan, having successfully taken the throne from his father, invaded Ifriqiya again and captured Tunis in August 1357, but he was soon forced by his own troops to abandon the region.
[7]: 111 During the mid-14th century, plague epidemics brought to Ifriqiya from Sicily caused a considerable fall in population, further weakening the Hafsid realm.
To stop raids from southern tribes during plague epidemics, the Hafsids turned to the Banu Hilal to protect their rural population.
[10]: 37 After the Marinid threat ended, attempts to reunify the Hafsids failed until Abu al-Abbas Ahmad II (r. 1370–1394), the emir of Béjaïa and Constantine, conquered Tunis in 1370.
[8] A capable ruler and military leader, he reestablished Hafsid authority on stronger terms, centralizing power to a greater extent than ever before.
[8] Abu Faris Abd al-Aziz II's reign (r. 1394–1434) was considered the apogee of Hafsid power and prosperity by contemporary writers.
He largely continued the strong rule of his predecessors but he had to contend with greater challenges, including internal politics, restive Bedouin tribes in the south, and the Wattasids in the west.
[18] He led two expeditions to Tlemcen in 1462 and 1466 and made the Zayyanids his vassals, while the Wattasid state in Morocco also formally accepted his authority.
A year later the King of Spain and Holy Roman Emperor Charles V seized Tunis, drove the Ottomans out and restored Muley Hassan as a Habsburg tributary.
The Hafsids also had a large stake in trans-Saharan trade through the caravan routes from Tunis to Timbuktu and from Tripoli to sub-Saharan Africa.
"[22]: 213 The Kasbah Mosque of Tunis was one of the first works of this period, built by Abu Zakariya (the first independent Hafsid ruler) at the beginning of his reign.
The Bardo Palace (today a national museum) was also begun by the Hafsids in the 15th century,[24] and is mentioned in historical records for the first time during the reign of Abu Faris.
It is with good reason that some wanted to find in this white standard that of the Almohads, of the same color, reproducing in turn that which the Fatimids had adopted.
"[30] Historian Charles-André Julien also speaks of Hafsid sovereigns doing parades with their court while hoisting their own white standard, overshadowing multicolored flags of embroidered silk.
The Book of Knowledge of All Kingdoms, written by a Franciscan friar in the 14th century, describes the flag of Tunis as being white with a black moon at its center.