Go Back

The Hafsid Dynasty

The Hafsids were a Berber dynasty that ruled Ifriqiya, roughly modern Tunisia and eastern Algeria, from 1229 to 1574. They took their name and their legitimacy from the Almohad movement: the founder, Abu Zakariyya Yahya, had served as the Almohad governor of Ifriqiya before he declared his independence about 1229 and made the province a kingdom of its own. Their three centuries matter because under them Tunis rose from a provincial town to a capital and one of the busiest trading cities of the Mediterranean, and because their rule gave Ifriqiya a durable identity as a distinct state between the empires of east and west.

Abu Zakariyya was an able ruler. He kept the Arab tribes of the countryside in check, secured his borders, and grew rich through trade agreements with Italian, Spanish, and Provencal merchants whose ships crowded the port of Tunis. His realm at its widest stretched from east of Algiers to Tripoli, and the peace he enforced made his court a refuge for scholars and craftsmen fleeing the Christian advance in Spain.

Caliph of the West

His son al-Mustansir, who reigned from 1249 to 1277, carried the dynasty to its height. When the Mongol sack of Baghdad in 1258 destroyed the Abbasid caliphate in the east, al-Mustansir assumed the title of caliph himself, and for a few years rulers from Morocco to Egypt acknowledged his religious prestige. It was the high point of Hafsid power: gold coinage struck in his name and that of his father circulated across the Mediterranean, and embassies came to Tunis from the trading republics of Italy and the courts of Africa.

Gold double dinar of Abu Zakariyya Yahya I
A gold double dinar of the founder Abu Zakariyya Yahya I, its faces covered in formal Arabic script - the Hafsids minted some of the finest coinage of the medieval Mediterranean. Image: Classical Numismatic Group, CC BY-SA 3.0.

The dynasty also fostered the Maliki school of law, whose judges and scholars shaped the social and religious life of Tunisia for centuries afterward. The great mosques and colleges of Tunis took form under Hafsid patronage, and the city's scholars corresponded with Cairo, Granada, and Timbuktu.

Crusade and Invasion

The later centuries were harder. In 1270 the Eighth Crusade, led by King Louis IX of France, landed before Tunis, where the king died of disease and his army withdrew only after extracting a heavy tribute. Then came internal dissension and the repeated invasions of the Marinids of Morocco, whose sultans twice occupied Tunis itself in the middle of the fourteenth century. Piracy and corsair raids along the coast added to the strain.

Sixteenth-century view of Tunis during the fighting of 1573-1574
Tunis in a colored view from the Civitates Orbis Terrarum, printed in the 1570s: the city, its lake, and the Ottoman camp and fleet during the final struggle of 1573-1574 that ended Hafsid rule. Public domain.

Yet the dynasty repeatedly recovered. Rulers like Abu al-Abbas in the late fourteenth century and Uthman in the fifteenth restored order and prosperity for decades at a time, and the city kept its place in Mediterranean trade. It was in this Tunis that the young Ibn Khaldun, born in the city in 1332, received his education and began the career in politics and scholarship that would produce his famous universal history.

Between Spain and the Ottomans

In the sixteenth century the Hafsids were caught in a struggle larger than themselves. Spanish garrisons seized points along the North African coast and took Tunis itself in 1535, while Ottoman Turkish forces and their corsair allies advanced from the east. The Hafsid sultans survived by leaning first on one power, then on the other, and their authority shrank to little more than the capital and its hinterland.

The contest ended in 1574, when an Ottoman fleet and army under Sinan Pasha took Tunis and La Goletta from the Spaniards. The last Hafsid ruler was carried off to Istanbul, and Tunis became a province of the Ottoman Empire, governed by pashas appointed from Constantinople.

Legacy

The Hafsids left Ifriqiya with its capital fixed at Tunis, its Maliki scholarship, its trading links with Europe, and a tradition of statehood that outlasted them. Later rulers of Tunisia, down to the modern republic, traced something of their country's separate identity back to the dynasty that first made Tunis the center of a kingdom.

To read more about this topic:

Britannica: Ḥafsid dynasty The Metropolitan Museum of Art: Western North Africa (The Maghrib), 1400–1600 A.D. Encyclopaedia Iranica: EBN ḴALDŪN, ABŪ ZAYD ʿABD-AL-RAḤMĀN BBC: BBC World Service