# Hammadid dynasty

Historical Berber states and dynasties :
Pre-Islamic Berber confederations and dynasties Mauretania 300 BC–44 AD Numidia 202 BC–25 AD Mauro-Roman kingdom 429 AD–578 AD Kingdom of Ouarsenis 430 AD–735 AD Kingdom of Capsus 440 AD–470 AD Kingdom of the Aurès 484 AD –703 AD Kingdom of Altava 578 AD–708 AD :
Post-Islamic kingdoms and caliphates Midrarid dynasty 757-976 Ifranid Dynasty 790-1066 Khattabid Dynasty 918-1177 Zirid dynasty 988–1069 Khazrunid Dynasty 1001-1146 Hammadid dynasty 1014–1152 Almoravid dynasty 1050–1147 Khurasanid dynasty 1058–1159 Almohad Caliphate 1121–1269 Hafsid dynasty 1229–1574 Zayyanid dynasty 1235–1557 Marinid Sultanate 1244–1465 Wattasid dynasty 1472–1554 Principality of Debdou 1430–1563 Kingdom of Beni Abbas 1510–1872 Kingdom of Kuku 1515–1638 Kingdom of Tazeroualt 17th - 19th century :
Western dynasties and taifas Taifa of Alpuente 1009–1106 Taifa of Morón 1010–1066 Taifa of Arcos 1011–1145 Taifa of Granada 1012–1114 Taifa of Albarracín 1013–1090 Taifa of Carmona 1013–1150 Taifa of Ronda 1039–1065 :
vte :
The Hammadid dynasty (Arabic: الحماديون, romanized: Al-Hāmmādiyūn, lit. 'children of Hammad'), also known as the Hammadid Emirate or the Kingdom of Bejaia,$^{:350}$ was a medieval Islamic kingdom$^{:240}$ in the central Maghreb, encompassing what is now Algeria. It was established at the beginning of the 11th century when Hammad ibn Buluggin declared himself emir, thus splitting the Zirid domains into two separate dynasties. Under the reign of Emir Al Nasir, the emirate briefly became the most important state in the Maghreb, and reached its greatest territorial extent, stretching from Tlemcen in the west to Tunis in the east,$^{:238}$$^{:362}$ and from the Mediterranean Sea in the north to the desert oasis of Ouargla and Oued Righ in the south.$^{:238}$ While they briefly controlled the principality of Fez in the west and cities like Sfax, Kairouan, Laribus, and Tripoli to the east.$^{:238}$
At first, Hammad built a fortified city that would serve as the capital for his newly declared kingdom.$^{:40}$$^{:234}$$^{:20}$ Later, upon the arrival of the Arabic Banu Hilal tribes, the capital would be replaced by another city, newly built by Emir Al Nasir ibn Alnas, called Al-Nāsiriyyah (from Arabic: الناصرية) and later renamed to Bejaia;$^{:100}$$^{:45}$ it was the official capital of the Emirate by 1090 during the rule of Al-Mansur.$^{:46}$ Both cities grew to become among the largest and most prosperous centers of the Maghreb, with Bejaia housing more than 100,000 inhabitants.$^{:59}$ The Hammadids subsequently clashed with the Almoravids in the west and their cousins the Zirids in the east.$^{:54}$$^{:80}$ The latter weakened with the rise of the prominent Normans in Sicily,$^{:47}$ who also confronted the Hammadids for the domination of Ifriqiya (now Tunisia).$^{:188}$$^{:98}$$^{:260}$ However, the Hammadids faced another challenge on their western borders with the growing force of the Almohad Caliphate,$^{:47}$ and their emirate was finally annexed by the Almohads in 1152 after a brief clash with them.$^{:47}$$^{:58}$

## History
### Establishment

In 987 and 989, al-Mansur ibn Buluggin, the emir of the Berber Zirid dynasty, appointed his uncle Hammad ibn Buluggin as governor of Ashir and western Zirid lands. Hammad subsequently defended the territory against Zenata incursions and was granted additional lands by al-Mansur's successor Badis ibn Mansur. In 1007 and 1008, forces under Hammad left Ashir and built a new citadel-capital, Qal'at Bani Hammad (also called Al Qal'a of Beni Hammad), in M'Sila Province in the Hodna Mountains; a thriving city sprang up around the fortress.
In 1014, Hammad declared his independence from Zirid suzerainty and switched his spiritual allegiance from the Shi'a Fatimid caliphs to the Sunni Abbasid caliphs of Baghdad. The Zirids failed to quash the rebellion and recognized Hammadid legitimacy in 1017, in a peace with al-Mu'izz that was sealed by Hammad's son and successor Qaid ibn Hammad (r. 1028–1054). The peace was further sealed by marriage, with al-Mu'izz's sister marrying one of Hammad's sons. According to historian Hady Roger Idris, it appears that the Hammadids agreed to recognize Fatimid suzerainty again at this time, but at some later point in his reign, perhaps around the same time as the Zirids did in the 1040s, Qa'id ibn Hammad repudiated Fatimid suzerainty again.
In 1039, Qaid ibn Hammad was attacked by Hammama, the ruler of Fes, but Hammama soon returned to Fez, requested peace, and declared his submission to the Hammadids.
Al-Mu'izz subsequently also broke with the Fatimids and changed his allegiance to the Abbasids. The Fatimid caliph, al-Mustansir, sent Bedouin Arab allies, the Banu Hilal and Banu Sulaym, into a mass migration and invasion of the lands in what is now Libya, Tunisia, and Algeria, culminating in al-Mu'izz's defeat in 1053 and the subsequent reduction of the Zirids to a small, insignificant territory based in Mahdia. Amidst the chaos, the Hammadids reverted their allegiance to the Fatimids and managed to negotiate an alliance with the Bedouin tribes.
Although the Hammadids and Zirids entered into an agreement in 1077 in which Zirid ruler Tamim's daughter married into the Hammadids, this did not end the rivalry between the dynasties. A common pattern was for Hammadids and Zirids to support "rival coalitions of Arab tribes to fight their proxy wars." The Hammidid–Zirid rivalry also influenced the choice of which caliph to recognize; historian Amar S. Baadj writes, "It would appear that the principle which the Hammadids followed in the course of their relations with Baghdad and Cairo was that of opposing the Zirids. Whenever the Zirids recognized one of two rival caliphs, the Hammadids would declare their submission to the other."

### Apogee

Buluggin ibn Muhammad (r. 1055–1062), a subsequent Hammadid ruler, invaded northern Morocco in 1062 and briefly took Fez for a few months, but was then assassinated by his paternal cousin An-Nasir ibn Alnas, who succeeded him as emir. The Hammadid dynasty peaked during al-Nasir's reign. Under his reign the Hammadids established their control across large parts of the Maghreb. Al-Nasir captured Constantine and Algiers, then established Hammadid influence far to the east in Sfax, where the local ruler acknowledged Hammadid suzerainty, as well as in Susa and Tripoli. At the request of local shaykhs, he was also able to install a loyal governor in Tunis until 1067. Between 1067 and 1072 he built Béjaïa, developing it from a small fishing village into a large, fortified town and port. The Hammadids also expanded south deep into the Sahara, with Ouargla forming the southernmost city of their territory. They briefly extended their authority further to the Oued Mya.
In the 11th century, the Hammadids came under increasing pressure from the Banu Hilal, who had settled in the Plains of Constantine and increasingly threatened Qal'at Bani Hammad. While initially allied to the Bedouins, the Hammadids later became their puppets, allocating half of their harvest yields to them and buying off tribesmen in order to secure the safety of trade routes. Qal'at Bani Hammad was eventually eclipsed by Béjaïa. In 1090, with the Banu Hilal menace rising, the Hammadids moved their capital to Béjaïa, yielding their southern territories to the Hilalians. The Hammadids maintained control of a small but prosperous coastal territory between Ténès and El Kala. E.J. Brill's First Encyclopaedia of Islam (1927) states that the Qal'at Bani Hammad "was not completely abandoned by al-Mansur and he even embellished it with a number of palaces. The Hammadid kingdom had therefore at this point two capitals joined by a royal road." Renamed al-Nasiriya to honor the emir, Béjaïa developed into a sophisticated trading city; under al-Nasir and his son and successor al-Mansur ibn Nasir, large gardens, palaces, a Great Mosque, and other landmarks were constructed in the town.
An-Nasir corresponded with Pope Gregory VII and expanded commercial opportunities for Italian traders in Béjaïa. The city then flourished as a trading port and a prominent intellectual centre where even Abu Madyan and the Andalusian Shaykh Abu Ali Hassan bin Ali Muhammad taught. Leonardo Fibonacci had also studied in Béjaïa; his father was appointed as collector of customs in Béjaïa and brought Leonardo with him. In Béjaïa Fibonacci was introduced to the Arabic numerical system and computational method; he later introduced this numerical system to Europe. He was also introduced to a book of algebra written by al-Khwarizmi.

### Decline

In 1103–1104 the Hammadids defeated the Almoravids and took control of Tlemcen. During the reign of al-Mansur's son Abd al-Aziz ibn Mansur (r. 1105–1121), Béjaïa had about 100,000 people, and the Hammadids consolidated their power in the city. The dynasty suffered a decline after this point; efforts to develop more sea power in the Mediterranean were foiled by the Normans, who by the 12th century had conquered Sicily and had also occupied a number of settlements on the coast of Tunisia and Algeria. However, Abd al-Aziz did expel the Hilalians from Hodna and capture Jerba.
The last dynastic emir was Yahya ibn Abd al-Aziz (r. 1121–1152). Yahya repulsed Bedouin incursions and subdued uprisings by Berber clans, but during his reign the Genoese also raided Béjaïa (1136), and the Kingdom of Sicily occupied the settlement of Djidjelli and destroyed a pleasure palace that had been built there. Tunis, whose Khurasanid rulers had previously vacillated between recognizing Zirid and Hammadid authority, was annexed in 1128 and controlled by Hammadid governors until 1148.
Yahya tried to establish good relations with the Fatimids in the early 1140s, but ultimately he recognized the Abbasids instead and minted coins in al-Muqtafi's name. In 1144 and 1145, he dispatched Hammadid forces to join the Almoravids in fighting, unsuccessfully, the Berber Almohads led by Abd al-Mu'min.
In 1145, Abd al-Mu'min conquered Tlemcen and Oran. In 1151, he marched against the Hammadids. The Almohads took Algiers in 1152 and captured Béjaïa later the same year, crushing Hammadid forces at the gates of the city. This marked a major military triumph for Abd al-Mu'min. Yahya fled to Constantine, but surrendered several months later. He died in comfortable exile in Salé, Morocco, in 1163. Abd al-Mu'min enslaved the women and children of Hammadid loyalists who had fought against him, but did not sack Béjaïa because the city had surrendered.
Some 30 years after the collapse of the Hammadids, the dynasty had a brief revival in 1184, when 'Ali ibn Ghaniya—a member of the Banu Ghaniya branch of the Almoravid dynasty, which had established a corsair kingdom in the Balearic Islands—seized control of Béjaïa, recruited a mixed force of "dispossessed Hammadids, Sanhaja Berbers, and Hilalian tribes" opposed to Almohad rule, and quickly captured Algiers, Miliana, Ashir, and al Qal'a, with the goal of establishing a new Almoravid polity in the Maghreb. Less than a year later, the Almohad had recaptured all the towns. The Banu Ghaniya did retain, through the end of the Almohad period, some influence in Tripolitania, southern Tunisia, and the Algerian plains, where Hammadid loyalists numbered among their allies.

## Territories

The Hammadid domain stretched across the entirety of the Central Maghreb, comprising the northern expanse of what is now Algeria. At its establishment during Hammad's reign, a pact was forged with his cousin Badis, stipulating that Hammad would retain authority over a substantial swath of the Central Maghreb (Algeria). This encompassed pivotal cities such as M'sila, Achir, and Tahert, alongside the territories of Tobna and Zab, as well as any lands annexed through his conquests. The kingdom's territories quickly expanded. Following Hammad's death, his son Sultan El Qaid ascended to power, and in 1038, a war erupted against the ruler of Fes. The latter swiftly backtracked and declared submission to the Hammadids.$^{:41}$$^{:234}$ Under the reign of Sultan Buluggin ibn Muhammad campaigns were conducted in the west to subdue the Zenata tribes.$^{:55}$ He defeated the Zenata and entered Tlemcen in 1058. At the same time, the governor of Biskra revolted against the Hammadids, but the rebellion was swiftly suppressed, and he was replaced.$^{:913}$$^{:56}$ In 1062, Bologhine learned that the Almoravids had seized control of the Maghreb Al Aqsa (Morocco) and launched a campaign into Morocco, pushing back the Almoravids into the desert.$^{:353}$$^{:56}$ He was assassinated by his successor on his return journey near Tessala.$^{:353}$
Under the reign of Al Nacer (1062–1089) the kingdom experienced the peak of its territorial expansion. The influence of the Hammadids extended into Ifriqiya (Tunisia),$^{:60}$ as the governors of Sfax and Tunis, to whom governance was entrusted to the Banu Khurasan, submitted to Al Nacer.$^{:354}$$^{:334}$ The people of Castilia (Tozeur) were notably brought under Hammadid rule.$^{:354}$ Shortly after the submission of these cities, Sultan Al Nacer conquered the city of Laribus, near Kef, in 1066 before entering Qayrawan,$^{:69}$$^{:235}$ although the latter quickly emancipated itself from Hammadid influence. The cities of Sousse and Tripoli also submitted to Al Nacer. He also conducted a southern expedition, during which he expelled the Ibadi from Sedrata and ended a revolt in Ouargla by replacing its governor. His successor Al Mansur later fought the Almoravids in the west, who continued to raid Hammadid territories. He gathered over 20,000 fighters and marched on Tlemcen,$^{:77}$ which, after a victorious battle against the armies of Ibn Tachufin,$^{:77}$ led to an agreement where the boundary between the two kingdoms was set at Tlemcen. In the eastern part of the kingdom, a rebellion broke out but was swiftly quelled by Al Mansour, who managed to recapture Bone from the rebels.$^{:358}$$^{:75}$ Few territorial changes occurred after the death of Sultan Al Mansour, notable among them being the capture of the island of Djerba by the Hammadid fleet under the reign of Abd Al Aziz,$^{:362}$$^{:235}$ as well as the reintegration of the Banu Khurasan of Tunis into the Hammadid kingdom.$^{:362}$ During the rule of the final monarch, Yahya, in the eastern regions, according to the author of Sahib Al Majam (from Arabic: صاحب المعجم), the lands of the Hammadid Sultan Yahya extended to the plains of Sig near Oran, marking the boundary between the Hammadids and the Almoravids.

## Administration

The governmental structure represented an Islamic absolute monarchy,$^{:236}$ where the head of state held the title of Emir or Sultan$^{:236}$ and the governance of the emirate was exclusively within the Hammadid dynasty. They did recognize the spiritual authority of the Fatimid Caliphate at first until the arrival of the Banu Hilal tribes, and then the Abbasid Caliphate at different times.$^{:236}$$^{:183}$ The Qada (from Arabic: القضاء) or Jurisdiction was separated from the administration and derived its rulings and legislative texts from the Maliki school of thought, which was prevalent among the people of the Maghreb and Al-Andalus.$^{:237}$ Arabic was the official language in the jurisdiction. Each city had a judge appointed by the Hammadid Emirs who was responsible for the affairs of Muslims,$^{:208}$ including complaints and other matters.$^{:109}$
Initially, the Hammadid emirs personally oversaw the administration of the emirate, later delegating this responsibility to viziers based in the capital,$^{:236}$ mostly not from the Hammadid dynasty.$^{:206}$$^{:186}$ They were given various tasks that included suppressing rebellions such as the Biskra rebellion during Bouloughin's reign and handling diplomatic correspondence with other kingdoms, particularly during Emir El Nacer's time.$^{:122}$ They were also tasked with managing both internal and external affairs.$^{:206}$ The Banu Hamdoune (from Arabic: بنو حمدون) family wielded significant influence in the kingdom since Emir Badis' reign.$^{:96}$ Among them, Mimoun ibn Hamdoune served as vizier during the tenure of the last Hammadid Emir Yahya, whose authority grew as the Emir focused on hunting and entertainment.$^{:122}$ The Hammadid central administration included the Diwan al-Insha (from Arabic: ديوان الإنشاء), headed by a secretary,$^{:122}$ whose importance lies in drafting treaties and agreements. Next to the Diwan al-Insha, the Hammadids had the Diwan al-Bareed (from Arabic: ديوان البريد), as the emir needed to correspond with other sultans, kings, and caliphs. The communication system was advanced during the era of the emirate, and mountain fire signals were built,$^{:210}$ as reflective mirrors were installed in lighthouses to reflect lights visible from a long distance.$^{:124}$ Thus, the nearby centers received their signals, and all centers transmitted them accordingly. They could have also used carrier pigeons like the Zirids.$^{:123}$
Regarding the administration of the kingdom's territories, most Umal (from Arabic: عمال Umal) (governors) were from the royal family, with their number fluctuating depending on the Sultan.$^{:123}$ Each city had its governor appointed by the Hammadid Sultan. Cities like Algiers, Bône, Constantine, Hamza, Achir, and Jijel each had an assigned governor.$^{:236}$ At its peak under the reign of Al Nacer, the Sultan appointed his brother Kbab, installed in Miliana, to govern the western territories.$^{:124}$ He also tasked the Banu Wemanou, a Zenata tribe located near Relizane, with overseeing the western territories of the kingdom. His second brother Ruman was assigned the governorship of Hamza (Bouira). The city of Constantine was given to his third brother Balbar, and N'Gaous to his fourth brother Khazar.$^{:124}$$^{:622}$ He also entrusted his son Ibn el Alaa with the governance of Algiers and Mers el Dejaj while his other son Yusuf with that of Achir.$^{:124}$$^{:622}$ Alongside these provinces, there were regions within the kingdom whose governance was assigned to other emirs, such as the region of Tozeur, which was given by Al Nacer to Yusuf ibn Makhluf.$^{:124}$ During this period, Tunis was under the governance of the Banu Khurasan,$^{:124}$ and Biskra under the Banu Ruman and later the Banu Sindi, both subject to Sultan Al Nacer.$^{:240}$ The city of Sfax was assigned to Hammu Ibn Malil.$^{:624}$ Al Nacer also had a governor in Ouargla whose name is not known.$^{:622}$$^{:124}$

## Art and architecture
### Architecture

Qal'at Beni Hammad, the dynasty's capital, was described by Al-Bakri in the 11th century as a large and powerful military stronghold and a centre of commerce that attracted caravans from all over the Maghreb, Iraq, Syria, Egypt and the Hejaz. 14th-century Arab historian and philosopher Ibn Khaldun noted that the abundance of travellers was due to the wealth of resources offered to those interested in sciences, commerce and arts. The Qal'at attracted poets, sages and theologians. It was filled with various richly decorated palaces, caravanserai, gardens and what remained the largest mosque built in North Africa until the twentieth century. The art and architecture of the Hammadids influenced that of the Arabs, Almohads, Almoravids and Normans.
Hammadid emirs constructed five palaces, most of which are now destroyed. The keep of the Palace of the Fanal (Qasr al-Manar), however, survives to this day. A minaret, 82 feet (25 m) in height, is the only remaining part of the ruined Great Mosque; the structure bears some resemblance to Seville's Giralda. The Hammadid mosque is said to have been the largest mosque constructed in North Africa prior to the twentieth century; it has the typical Maghreb-style square minaret. Architecture in Qal'at Bani Hammad featured adornments of "porcelain mosaics of many-colored faience, sculpted panels and plaster, enameled terra-cotta stalactites; building and pottery ornamentation consisted of geometric designs and stylized floral motifs."
Ibn Hamdis wrote two different poems describing one of the Hammadid palaces which he described as having interior courts of marble that looked as if they had been carpeted with crystal, and he observed that the grounds looked as if they were strewn with fine pearls. His description mentions that the palace had a pool that was bordered by marble lions with water streaming from their mouths; these lions were likely similar to those of the Alhambra.
In the Qal'at Beni Hammad fragments of stucco were discovered from the Qasr al-Salam and the Qasr al-Manar which may be the oldest fragments of muqarnas in the Western Islamic world, dating back to the 11th or 12th century.$^{:133}$ According to Lucien Golvin the fragments of the muqarnas semi-dome at the Qasr al-Salam are the oldest documented remains of a true muqarnas vault in the Islamic world. However, other scholars of Islamic architecture have questioned or rejected the dating of these fragments or their identification as true muqarnas.$^{:93}$
Furthermore, the Qal'at buildings are considered to be documented antecedents and precursors to certain developments in Western Islamic art in the 12th century. Plaster capitals that were found at the Qal'at were composed of smooth leaves recurved in their upper part, considered to be an antecedent to the common Almoravid and Almohad forms which are seen in the Great Mosque of Tlemcen or in Tinmel. The framework of a marble basin and a grey marble fragment document the use of multifoil arches with spiral-form impost decoration. The use of this motif at the Qal'at subsequently spread during the times of the Almoravids and became universal in Almohad buildings. The square rooms surrounded by rampant barrel vaults in the Qasr al-Manar have been compared to the Almohad minarets and the Torre Pisana in Palermo which it predates. The Hammadid palaces are also noted to contain the first or one of the first documented use of shadirwan.

### Art

The excavations in the Qal'at Beni Hammad also discovered the first reference corpus of Islamic ceramics. The production of ceramics in Al-Andalus during the taifa and Almoravid periods reflect a strong and direct Hammadid influence. The technique of luster-painting on pottery was passed from al Qal-at to Béjaïa to Malaga, and black painted and incised earthenware objects as well as bronze sculptures from the Zirids most likely influenced similar objects in Andalusia. Ceramic architectural decorations had never played such a large role in the Islamic world until the Hammadids, and from there it subsequently spread to Al-Andalus and Morocco where it became a hallmark for the architecture of these countries, and it also spread throughout Europe.
Luster-painted and glazed ceramic decoration in a wide variety of shapes and forms were a feature in the Islamic architecture of Hammadid-era Béjaïa. Al-Nasir reputedly negotiated with Pope Gregory VII for the services of Italian masons and other skilled craftsmen for the construction of Béjaïa. Although Béjaïa is mostly in ruins, a large sea gate reportedly survives. The Bab al-Bahr (gate of the sea) was built during an-Nasirs reign, along with five other gates, to protect the town. It is now a ruin consisted of a pointed arch constructed with solid bricks. The Bab al-Bunud was also built in Béjaïa during an-Nasirs reign with hexagonal towers and two ogival-arch gates.
In Béjaïa drawings of a facade of two palaces with ground plans by one of the Hammadids have been preserved and provide an insight into palatial architecture of the time period of the Hammadids. The first palace consisted of a huge domed hall flanked by smaller domed towers and chambers. The second palace, called al-Kukab, as said to have been where the Bordj Moussa is today. al-Kukab consisted of a large centred hall with a gabled roof flanked by side aisles and two small towers.
The Great Mosque of Constantine was originally constructed by the Hammadids in the 12th century and was built on the ruins of a Roman temple.

## List of rulers

The following is a list of Hammadid rulers, starting at Hammadid independence from the Zirids in 1015 and ending with the Almohad conquest in 1152:
Hammadid Emirs :
| Emir | Reign |
| ʿHammad ibn Buluggin | 1015 – 1028 |
| Qaid ibn Hammad ibn Buluggin | 1028 – 1054 |
| Muhsin ibn Qaid | 1054 – 1055 |
| Buluggin ibn Muhammad ibn Hammad | 1055 – 1062 |
| An-Nasir ibn Alnas | 1062 – 1088 |
| Al-Mansur ibn al-Nasir | 1088 – 1105 |
| Badis ibn Mansur | 1105 |
| ʿAbd al-Aziz ibn Mansur | 1105 – 1121 |
| Yahya ibn Abd al-Aziz | 1121 – 1152 |
| End of the Emirate ||