The Hafsid Dynasty, from the 13th to 16th centuries, ruled Ifriqiya (modern Tunisia, eastern Algeria, and western Libya). Originating as a Berber dynasty, it became a major centre for trade and learning, with Tunis as its capital. The Hafsids notably maintained autonomy amid regional pressures.

Artist impression of the Hafsid Dynasty in digital art.

The Hafsid Dynasty at its peak

Abd al-Aziz (1394-1434) was a remarkable leader of the Hafsid Dynasty whose reign brought a time of prosperity and progress to the country. Despite facing early challenges, he proved himself to be a strong and capable ruler by quickly regaining control of the southern cities that revolted against him. He was determined to strengthen his kingdom, and under his leadership, Tozeur (1404), Gafsa (1401), and Biskra (1402) were all reoccupied. He even appointed libertarian governors to the regions of Constantine and Bugia (1397-1402), who were elected by the people.

Artist impression of Abd-al-Aziz of the Hafsid Dynasty

Abd al-Aziz was not one to shy away from conflict, and he demonstrated this by annexing Tripoli (1401) and Algiers (1410-1411). He also defeated the Zayyanid dynasty and replaced it with a pro-Hafsid ruler, who would later revolt against him in 1428 and 1431. In 1429, the Hafsid Dynasty attacked the island of Malta and took 3000 slaves. The spoils of war were used to support art and culture, which greatly enriched the lives of the people. However, piracy also had negative consequences, as Christians launched attacks and crusades against coastal cities of the Hafsid Dynasty, such as the Barbary crusade (1390), the Bona crusade (1399), and the capture of Djerba in 1423.

Abd al-Aziz’s efforts to expand his kingdom continued even as he aged. In 1432, he launched another expedition against Tlemcen but died during the campaign. Under Utman (1435-1488), the Hafsid Dynasty continued to prosper. They reached their zenith by developing caravan trade through the Sahara and with Egypt and by establishing sea trade with Venice and Aragon. The Bedouins and cities of the empire became largely independent, but Tunis and Constantine remained under the control of the Hafsid Dynasty.

Artist impression of trade ships of the Hafsid Dynasty.

The Hafsids ruled over a land of abundance, where fertile soil and strategic trade routes made it one of the wealthiest regions of the world. Their choice of Tunis as the capital was a shrewd decision, as its coastal location made it a hub for trade between the Western and Eastern Mediterranean. This allowed Christian merchants to set up enclaves in various cities, facilitating commerce and diplomacy between different cultures. However, this prosperity also attracted the unwanted attention of pirates who preyed upon Christian ships and put a strain on the region’s security.

Despite the challenges, the Hafsid Dynasty continued to build upon their commercial success, forging links with sub-Saharan Africa and the bustling caravan routes from Tunis to Timbuktu. The population of Tunis swelled to 100,000, and the Hafsids fostered education, establishing renowned university mosques in Kairouan, Tunis, and Bijaya. Kairouan became the centre of the Maliki school of religious doctrine, and the people of Tunisia became increasingly literate and enlightened. Under the Hafsids, the world was at their doorstep, and they eagerly embraced the cultural and economic opportunities it offered.

Artist impression of the city of Timbuktu at its peak

Utman was a conqueror who added to the Hafsid Dynasty by taking control of Tripolitania in 1458 and appointing a governor in Ouargla in 1463. He also led two expeditions in Tlemcen in 1462 and 1466 and made the Zayyanids his vassals. The Wattasid state in Morocco became a vassal of Utman, making the entire Maghreb briefly under the rule of the Hafsids. Under Utman’s leadership, the Hafsids became a force to be reckoned with, and his legacy continued to shape the country for years to come.

Fall of the Hafsids

In the 16th century, the Hafsids found themselves helplessly trapped in a fierce power struggle between Spain and the Ottoman Empire-supported Corsairs, as both were determined to gain control over Tunis. The Ottomans triumphantly took over Tunis in 1534, driving out the Hafsid ruler Muley Hassan. But their victory was short-lived, as the King of Spain and Holy Roman Emperor Charles I and V swooped in a year later, expelled the Ottomans and reinstated Muley Hassan as a Habsburg tributary.

Artist impression of Ottoman soldiers.

Despite this temporary triumph, the Hafsids remained under the constant threat of Ottoman domination, making them subservient to Spain after 1535. The Ottomans seized Tunis once again in 1569, and their four-year-long reign of terror caused unimaginable suffering to the Tunisian people. But hope was not lost, as Don Juan of Austria recaptured Tunis in 1573, only to lose it once again to the Ottomans in 1574. It was then that the Ottomans executed Muhammad VI, the last Caliph of the Hafsids, for his association with Spain and their desire to take the title of Caliph, as they now controlled Mecca and Medina.

Despite the Ottoman’s vicious massacre of the Hafsids, a glimmer of hope emerged as a branch of the family was rescued by the Spanish and taken to the Canary Island of Tenerife. The Hafsids’ fate was nothing short of tragic, as they watched their beloved homeland become a pawn in a ruthless game of power, leaving countless lives shattered and dreams destroyed.

Related Posts


Encyclopedia Britannica. “Hafsid dynasty.” Accessed February 20, 2023.

Rouighi, Ramzi. The Making of a Mediterranean Emirate: Ifriqiya and Its Andalusis, 12-14. The Middle Ages Series. University of Pennsylvania Press, Inc., 2011.

“Hafsid Dynasty.” Wikipedia, The Free Encyclopedia. Wikimedia Foundation, Inc. Accessed on February 19, 2023.