Hafsid dynasty

1229–1574 Sunni Berber dynasty in North Africa

Read the original on Wikipedia β†— Last updated from Wikipedia: 30 November 2026

For the Cretan dynasty, see Emirate of Crete (opens on Wikipedia).
Hafsid dynasty
Ψ§Ω„Ψ­ΩΨ΅ΩŠΩˆΩ†
1229–1574
Realm of the Hafsid dynasty in 1400 (orange)
Realm of the Hafsid dynasty in 1400 (orange)
CapitalTunis
Common languagesArabic
Berber languages
Religion
GovernmentMonarchy
Sultan and Caliph (opens on Wikipedia) 
β€’ 1229–1249
Abu Zakariya
β€’ 1574
Muhammad VI (opens on Wikipedia)
History 
β€’ Established
1229
1535
1574
CurrencyGold dinar (opens on Wikipedia)
Silver dirham (opens on Wikipedia)
Preceded by
Succeeded by
Image not shown for licensing reasons. View on Wikipedia Almohad Caliphate
Ottoman Tunisia Image not shown for licensing reasons. View on Wikipedia
Regency of Algiers Image not shown for licensing reasons. View on Wikipedia
Spanish Tripoli Image not shown for licensing reasons. View on Wikipedia
Kingdom of Kuku Image not shown for licensing reasons. View on Wikipedia
Ottoman Tripolitania Image not shown for licensing reasons. View on Wikipedia
Today part of

The Hafsid dynasty (Arabic: Ψ§Ω„Ψ­ΩΨ΅ΩŠΩˆΩ†, romanized: al-αΈ€afαΉ£iyΕ«n) was a Sunni Muslim dynasty of Berber descent[2] that ruled Ifriqiya (modern day Tunisia, western Libya, and eastern Algeria) from 1229 to 1574. The dynasty was founded by Abu Zakariya Yahya, who was initially appointed governor of the region by the Almohad caliph before declaring his independence.

Under the reigns of Abu Zakariya and his successor, al-Mustansir (opens on Wikipedia) (r. 1249–1277), the Hafsids consolidated and expanded their power, with Tunis as their capital. After al-Mustansir's death, internal conflicts resulted in a division between an eastern branch of the dynasty ruling from Tunis and a western branch ruling from BΓ©jaΓ―a and Constantine.[3] A reunification took place under Abu Yahya Abu Bakr II (opens on Wikipedia) (r. 1318–1346), but his death was followed by another crisis during which the Marinids, based in present-day Morocco, invaded briefly. Eventually, unity was re-established by Abu al-Abbas Ahmad II (opens on Wikipedia) (r. 1370–1394), who inaugurated the apogee of Hafsid power and influence across the region, which continued under Abu Faris Abd al-Aziz II (r. 1394–1434) and Abu 'Amr 'Uthman (opens on Wikipedia) (r. 1435–1488). After this, their power gradually declined. During the 16th century, as the Ottoman Empire encroached on the region, the Hafsids were propped up by Spain until the final Ottoman conquest of Tunis in 1574 put an end to their reign.[3]

The Hafsid period in Ifriqiya was also marked by important cultural and intellectual activity, encouraged in part by Abu Zakariya Yahya's decision to welcome Andalusi migrants and refugees. The medieval historian, Ibn Khaldun, was born in Tunis during this time. Hafsid architectural patronage (opens on Wikipedia) included, among other things, the first madrasas in the Maghreb.[3]

Almohad Ifriqiya

The Hafsids were of Berber descent,[2] although to further legitimize their rule, they claimed Arab ancestry from the second Rashidun (opens on Wikipedia) caliph Omar (opens on Wikipedia).[4] The ancestor of the dynasty (from whom their name is derived), was Abu Hafs Umar ibn Yahya al-Hintati, a Berber from the Hintata (opens on Wikipedia) tribal confederation,[5] which belonged to the greater Masmuda confederation in present-day Morocco.[6] He was a member of the Council of Ten, one of the highest Almohad political bodies, and a close companion of Ibn Tumart, the Almohad movement's founder.[5]

The son of Abu Hafs, Abu Muhammad Abd al-Wahid ibn Abi Hafs, was appointed by the Almohad caliph Muhammad al-Nasir as governor of Ifriqiya (generally present-day Tunisia, eastern Algeria, and western Libya) where he ruled from 1207 to 1221.[7] He was established in Tunis, which the Almohads had chosen as the province's administrative capital.[8]:β€Š133β€Š His appointment came in the wake of the defeat of Yahya Ibn Ghaniya, who had launched a serious attack against Almohad authority in the region. Abu Muhammad Abd al-Wahid was ultimately quite effective in keeping order. 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. This laid the groundwork for a future Hafsid state.[9]:β€Š101,β€Š119β€Š

When Abu Muhammad Abd al-Wahid died in 1221, the Almohad chiefs in Ifriqiya initially elected his son, Abu Zayd Abd al-Rahman, as the next governor. However, the Almohad caliph in Marrakesh, Yusuf II al-Mustansir, had not consented to this and was able to overrule this and appoint his own relative to the position.[9]:β€Š119β€Š As Almohad authority weakened over the following years, local opposition to the Almohad governor compelled the Almohad caliph Abdallah al-Adil to appoint another Hafsid family member to the post in 1226. He chose Abu Muhammad Abdallah, a grandson of Abu Hafs. Abu Muhammad Abdallah's brother, Abu Zakariya Yahya, arrived in Tunis before him and began to reestablish order.[9]:β€Š119β€Š When al-Ma'mun, the brother of Abdallah al-Adil, rebelled against the latter's authority from al-Andalus, Abu Zakariya sided with him, whereas Abu Muhammad Abdallah remained loyal to the caliph in Marrakesh. Al-Ma'mun's eventual victory resulted in Abu Zakariya being placed in charge of Ifriqiya in 1228.[9]:β€Š119β€Š

Rise to power

A year later, in 1229, al-Ma'mun officially renounced Almohad doctrine (opens on Wikipedia). Abu Zakariya used this as a pretext to repudiate his authority and to declare himself independent. By this point, Al-Ma'mun did not have the means to stop him or to reassert control over Ifriqiya.[9]:β€Š119β€Š Initially, Abu Zakariya had his name mentioned in the khutba (opens on Wikipedia) (the sermon during Friday prayer) with the title of amir, but in 1236 or 1237 he began to adopt the caliphal (opens on Wikipedia) title of Amir al-Mu'minin, in direct challenge to the Almohad caliph in Marrakesh.[9]:β€Š119β€Š He also initially organized the state around the Almohad elites, portraying his regime as a continuation of the Almohad system and placing Hafsid family members and Almohad shaykhs (tribal chiefs) in most important positions. He created the post of shaykh al-muwahhidin ('Chief of the Almohads'), often held by a Hafsid family member, who served as the ruler's deputy and to whom all the Almohad chiefs answered.[9]:β€Š126–127β€Š

Abu Zakariya annexed Constantine (Qusantina) and BΓ©jaΓ―a (Bijaya) in 1230.[7] In 1234, he chased Yahya Ibn Ghaniya out of the countryside south of Constantine in 1234, ending this lingering threat.[7] In 1235 he captured Algiers and then established his authority as far as the Chelif River to the west.[7] In the following years he subdued various rural tribes, such as the Hawwara, but allowed some of the Banu Tujin tribes in the central Maghreb to govern themselves as small vassal states that secured his western borders.[7] He welcomed many refugees and immigrants from al-Andalus who were fleeing the advance of the Reconquista. 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.[3]

For a time, the Nasrid (opens on Wikipedia) ruler of Granada in al-Andalus, Ibn al-Ahmar (opens on Wikipedia), briefly acknowledged Abu Zakariya's suzerainty in an attempt to enlist his help against Christian forces. Ultimately, Hafsid intervention on the Iberian Peninsula was limited to sending a fleet to Muslim Valencia's aid in 1238.[9]:β€Š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. In 1242, he captured Tlemcen from the Zayyanids, but the Zayyanid leader Yaghmurasan evaded him. The two leaders eventually came to an agreement, with Yaghmurasan continuing to rule in Tlemcen but agreeing to formally recognize Abu Zakariya's authority.[9]:β€Š120β€Š That same year, Sijilmasa and Ceuta (Sabta) also recognized his authority,[9]:β€Š120β€Š though these would later fall under Marinid control.[9]:β€Š107,β€Š136β€Š This policy of western expansion ended with Abu Zakariya's death (1249).[9]:β€Š120β€Š

Consolidation and division

Hafsids Bougie Algeria 1249 1276 ornemental Kufic.JPG
Coin of the Hafsids with ornamental Kufic (opens on Wikipedia), from BΓ©jaΓ―a, Algeria, 1249–1276. Image: PHGCOM, CC BY-SA 3.0, via Wikimedia Commons

His successor, Muhammad I al-Mustansir (opens on Wikipedia) (r. 1249–1277), focused on consolidating the Hafsid state in Ifriqiya. The state benefited from expanding trade with both Europe and the Sudan region (south of the Sahara).[9]:β€Š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.[9]:β€Š120β€Š With the fall of Baghdad (opens on Wikipedia), the home of the Abbasid caliphs, that same year, the Hafsids were briefly seen as the most important rulers of the Muslim world. The Sharif of Mecca (opens on Wikipedia), Abu Numayy (opens on Wikipedia), temporarily recognized him as caliph in 1259.[9]:β€Š120β€Š[10]:β€Š97β€Š

Louis IX landing at Tunis, and French being cut off by Saracens in tower, from Chroniques de France ou de St Denis, 14th century (22528512660).jpg
Louis IX of France (opens on Wikipedia) lands at Tunis in 1270; French soldiers attempting to enter the city are killed by Tunisian soldiers. (Grandes Chroniques de France (opens on Wikipedia)) Image: Levan Ramishvili from Tbilisi, Georgia, Public domain, via Wikimedia Commons

It was during his reign that the failed Eighth Crusade took place, led by Louis IX of France (opens on Wikipedia). After landing at Carthage, Louis died of dysentery in the middle of his army decimated by disease in 1270.

Paix entre Philippe III et le roi de Tunis - Lyon, BM, Ms 880.jpg
Philip III of France (opens on Wikipedia) concludes the Treaty of Tunis (opens on Wikipedia) with Hafsid sultan Muhammad I al-Mustansir (opens on Wikipedia). (1270) Image: Unknown authorUnknown author, Public domain, via Wikimedia Commons

After al-Mustansir's death in 1277, the Hafsids were riven by internal conflict, aggravated by interference from Aragon.[9]:β€Š123β€Š This resulted in a split in the dynasty: one branch ruled from Tunis in the east and another branch ruled from BΓ©jaΓ―a (Bijaya) and Constantine (Qusantina) in the west. 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.[3] After the initial split, the first successful reunification took place under Abu Yahya Abu Bakr II (opens on Wikipedia) (r. 1318–1346), the ruler of the western branch who managed to take control of Tunis.[3]

From around the end of the 13th century onward, the Hafsids could no longer rely on the Almohad legacy to legitimize their rule. Over the course of the 13th century, the incorporation of Andalusi migrants into both the state and the army, as well as the employ of European Christian mercenaries, left the old Almohad elites as a smaller faction within the ruling system who caused instability rather than providing it. Abu Yahya Abu Bakr II's predecessor in Tunis, Abu Zakariya Ibn al-Lihyani (opens on Wikipedia) (r. 1311–1317), signalled a further break with the Almohad past by having the name of Ibn Tumart (the Almohad founding figure) dropped from the Friday khutba.[9]:β€Š126–127β€Š

Marinid invasions and internal crisis

Abu Yahya Abu Bakr's rule remained unstable and he resorted to making alliances with the Zayyanids and Marinids to the west.[3] His agreement with the Marinid ruler, Abu al-Hasan (r. 1331–1348), included a marriage to his sister, who subsequently died during a failed Marinid expedition in Spain (opens on Wikipedia), followed by another marriage to his daughter.[9]:β€Š110β€Š When Abu Yahya Abu Bakr died in 1346, his intended heir, Abu'l Abbas, was killed in Tunis by his brother, Umar, who seized power. Abu'l Abbas's chamberlain, Abu Muhammad Abdallah ibn Tafrajin, sent a letter to Abu al-Hasan urging him to intervene and invade Ifriqiya. Abu al-Hasan, having already conquered Tlemcen in 1337, seized the opportunity to further expand. He conquered Tunis in 1347 and the Hafsid governors in the region accepted his authority.[9]:β€Š110β€Š

The invasion, however, disturbed the balance of power in favour of the Bedouin Arab tribes, whom the Marinids were unable to sway.[9]:β€Š111,β€Š128β€Š Ibn Tafrajin, who had hoped to be placed in power by the Marinids, fled to Egypt. The situation in Ifriqiya devolved into further disorder and internal rivalries, and Abu al-Hasan was forced to return west in 1349, partly to deal with a coup d'Γ©tat by his son, Abu Inan. Ibn Tafrajin returned to Ifriqiya and, with Bedouin support, installed another young son of Abu Yahya Abu Bakr, Abu Ishaq, as ruler.[9]:β€Š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. He returned west, retaining control only of Constantine and the cities of the central Maghreb for a time.[9]:β€Š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.[11]:β€Š37β€Š

Apogee

Double page from the Purple Qur'an.jpg
Double page from the Qur'an manuscript endowed to the Kasbah Mosque (opens on Wikipedia) by sultan Abu Faris Abd al-Aziz II in March 1405. Bibliothèque nationale de France (opens on Wikipedia).[12] Image: anonymous, Public domain, via Wikimedia Commons

After the Marinid threat ended, attempts to reunify the Hafsids failed until Abu al-Abbas Ahmad II (opens on Wikipedia) (r. 1370–1394), the emir of BΓ©jaΓ―a and Constantine, conquered Tunis in 1370.[3] A capable ruler and military leader, he reestablished Hafsid authority on stronger terms, centralizing power to a greater extent than ever before. Meanwhile, the Zayyanids and Marinids were occupied by internal matters.[3] The Almohad-based institutions of the state, such as the office of shaykh al-muwahhidin, also lost any remaining importance after this time.[9]:β€Š132β€Š

Abu Faris Abd al-Aziz II's reign (r. 1394–1434) was considered the apogee of Hafsid power and prosperity by contemporary writers. He further consolidated his dynasty's power in Ifriqiya and extended his influence over the Zayyanids and Marinids (and the Wattasids who succeeded the latter).[3]

The beginning of his reign was not easy since the cities of the south revolted against him. However, the new sultan quickly regained control: he reoccupied Tozeur (1404), Gafsa (1401), and Biskra (1402), subdued tribal power in the regions of Constantine and BΓ©jaΓ―a (1397–1402), and appointed governors of these regions to be elected officers. He also intervened against his western and eastern neighbors. He annexed Tripoli (1401) and Algiers (1410–1411).[13] In 1424, he defeated the Zayyanid sultan, Abu Malik Abd al-Wahid, and placed another Zayyanid, Abu Abdallah Muhammad IV, on the throne of Tlemcen as his vassal.[14][15] In 1428, the latter became embroiled in another war with Abu Malik Abd al-Wahid – who had now won his own support from the Hafsids – and was eventually replaced by yet another Zayyanid relative with Abu Faris Abd al-Aziz's help in 1431.[15] Around the same time (probably in 1426), Abu Faris Abd al-Aziz also helped to install Abd al-Haqq II on the Marinid throne in Fez – under the regency of Abu Zakariya Yahya al-Wattasi – and thus obtained from him a recognition of Hafsid suzerainty.[16]

In 1429, the Hafsids attacked the island of Malta (opens on Wikipedia) and took 3000 slaves, although they did not conquer the island.[17] Kaid Ridavan (opens on Wikipedia) was the military leader during the attack.[18] The profits were used for a great building programme and to support art and culture. However, piracy also provoked retaliation from the Christians, which several times launched attacks and crusades against Hafsid coastal cities such as the Barbary crusade (1390), the Bona crusade (opens on Wikipedia) (1399) and the capture of Djerba in 1423.

Abu Faris Abd al-Aziz II died in 1434 during another expedition against Tlemcen.[3] His successor, Abu 'Amr 'Uthman (opens on Wikipedia), had the longest reign of any Hafsid (r. 1435–1488). 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.[3]

Uthman conquered Tripolitania in 1458 and appointed a governor in Ouargla in 1463.[19] 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. The entire Maghreb was thus briefly under Hafsid suzerainty.[20][9]:β€Š132β€Š

Fall

In the 16th century, the Hafsids became increasingly caught up in the power struggle between Spain and the Ottoman Empire-supported Corsairs. The Ottomans conquered Tunis in 1534 and held it for one year, driving out the Hafsid ruler Moulay Hassan (opens on Wikipedia). 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.[21] Due to the Ottoman threat, the Hafsids were vassals of Spain after 1535. The Ottomans again conquered Tunis in 1569 and held it for four years. Don Juan of Austria (opens on Wikipedia) recaptured it in 1573. The Ottomans reconquered Tunis in 1574, and Muhammad VI (opens on Wikipedia), the last Caliph of the Hafsids, was brought to Constantinople and was subsequently executed due to his collaboration with Spain and the desire of the Ottoman Sultan to take the title of Caliph (opens on Wikipedia) as he now controlled Mecca and Medina.

Demographic developments

Ca. 1560 view of Tunis by Agostino Veneziano.jpg
View of Tunis c. 1560 (Agostino Veneziano (opens on Wikipedia)) Image: Agostino Veneziano, Public domain, via Wikimedia Commons

The demographics of Ifriqiya changed considerably during the Hafsid period and in the period leading up to it. The large-scale influx of Arab Bedouin tribes into the countryside during the preceding centuries promoted the Arabization of Ifriqiya. Aside from some relatively isolated region such as Djerba and the Nafusa Mountains, where Berber languages continued to be spoken, nearly all of Ifriqiya became fully Arabized during this era.[20]:β€Š151–152β€Š Additionally, and perhaps also due in part to the Bedouin migrations, the urban population became concentrated along coastal cities instead of inland towns, though major oases and inland centres like Kairouan and Constantine remained significant.[20]:β€Š152β€Š By the mid-14th century, the population of Tunis had grown to 100,000, making it one of the largest cities in the world at the time.[11]:β€Š35β€Š

Andalusi migrants and refugees, who fled the advance of the Christian conquests in the Iberian Peninsula, became an important element of the urban population. These migrants were culturally Arab and followed the Maliki legal school (maddhhab) of Sunni Islam.[9]:β€Š127β€Š The Hafsids relied upon them heavily as scribes, bureaucrats, and other government officials.[22]:β€Š321β€Š[9]:β€Š127β€Š

Religion

The Hafsid rulers continued to follow Almohad doctrine (opens on Wikipedia) initially, at least officially, but Almohadism was not widely followed among the rest of the population. The Hafsids tolerated the activities of Sunni islamic scholars (ulama) from the regionally dominant Maliki school and eventually, during the 14th century, these scholars came to occupy most religious offices in the state.[9]:β€Š132–133β€Š Tunis also replaced Kairouan, the former traditional capital of Ifriqiya, as the main center of religious scholarship. Ibn 'Arafa, who served as the imam of the Zaytuna Mosque in Tunis from 1355 to 1401, was one of main figures in this Maliki revival. In turn, the Malikis provided support to the Hafsid resurgence in the later 14th century.[9]:β€Š133β€Š

Among other things, the Malikis served as a counterweight to the growing influence of Sufi saints. Cults based around these saints had grown in importance across the country, especially in the countryside and among the Arab tribes there. The Hafsids remained wary of this trend, which undermined centralized authority, and thus allied with the more urban Maliki scholars.[9]:β€Š133–134β€Š[8]:β€Š139–140β€Š Nonetheless, Sufism grew into one of the most important aspects of Islam in the region, with zawiyas (Sufi religious complexes) founded in many locations, sometimes under the protection of local tribes, and reached some level of accommodation with central authorities.[22]:β€Š322–323β€Š

Non-Muslims

Under Almohad rule, Jews were treated poorly, and their communities nearly disappeared. Under the Hafsids, a policy of tolerance returned and allowed their communities to recover. Jews were prominent as merchants, moneylenders, and craftsmen. The recovery was also aided by the arrival of Jewish refugees fleeing persecution on the Iberian Peninsula, particularly after their 1492 expulsion from Spain.[8]:β€Š177–178β€Š[20]:β€Š152–153β€Š Jews elected a leader who represented them before the sultan and were allowed to govern themselves according to rabbinical law (opens on Wikipedia), though Islamic law and tribunals still had priority where relevant.[8]:β€Š178β€Š

What was left of indigenous Christianity in Ifriqiya had disappeared in the 13th century under Almohad rule.[20]:β€Š153β€Š In contrast again with the Almohads, the Hafsids showed a marked toleration for Christianity, in part because they sought commercial ties with European Christian states, who saw this toleration as a requisite for normal relations. Treaties were struck with individual states that also laid out the conditions under which Christians lived in Hafsid domains. These included rights, such as diplomatic representation by a consul (opens on Wikipedia), as well as restrictions, such as prohibiting merchants from bringing their spouses to live with them.[8]:β€Š178–179β€Š Most of these Christians were merchants from countries around the Mediterranean such as Catalonia, southern France, and the maritime republics (opens on Wikipedia) of Italy.[8]:β€Š178β€Š[11]:β€Š35β€Š

Starting sometime in Abu Zakariya's reign (r. 1229–1249), Catalonian Christian mercenaries were brought into the service of the Hafsid army as a result of Hafsid relations with the Kingdom of Aragon. The king of Aragon retained some formal authority over this mercenary corps, while other European Christians joined its ranks over time. Aragonese subjects had a dedicated fondouk (opens on Wikipedia), a compound that provided lodging and services, in both Tunis and BΓ©jaΓ―a.[9]:β€Š121–127β€Š[20]:β€Š153–154β€Š By the 15th century, the descendants of these and other mercenaries continued to form the ruler's personal guard but had assimilated to Arab culture.[22]:β€Š321β€Š

Loading β€œEconomy”…

Loading β€œCulture”…

Loading β€œFlags”…

Loading β€œHafsid rulers”…

Loading β€œSee also”…

Loading β€œReferences”…

Image credits (9)