# Badr al-Jamali

Abu'l-Najm Badr ibn Abdallah al-Jamali al-Mustansiri, better known as Badr al-Jamali (Arabic: بدر الجمالى) or by his eventual title as Amir al-Juyush (أمير الجيوش, lit. 'Commander of the Armies'), was a military commander and statesman for the Fatimid Caliphate under Caliph al-Mustansir. Of Armenian origin but a convert to Islam, Badr had been brought up as a military slave (mamluk) by the ruler of Tripoli, Jamal al-Dawla ibn Ammar. In the 1060s, he was appointed twice as governor of Damascus in Syria, at a time when Fatimid authority there was disintegrating, and the central government in Egypt was on the verge of collapse as a result of the Mustansirite Hardship. Badr was unable to prevent the loss of most of Syria to local potentates and Turkoman warlords, but managed to hold on to the coastal cities, making Acre his base.
As the sole major military commander outside Egypt, he was called upon by al-Mustansir to help rescue the dynasty. Badr landed in Egypt in late 1073, rapidly eliminated his rivals, and was appointed vizier with plenipotentiary powers, making him a quasi-sultan or military dictator, with the caliph relegated to his religious duties as Isma'ili imam. Control over the state was solidified with the marriage of one of his daughters to al-Mustansir, and the appointment of his own son, al-Afdal Shahanshah, as his successor in 1085. Badr managed to restore order in Egypt and initiated major administrative reforms, defeated Turkoman attempts to invade Egypt, and recovered control over Palestine and the Hejaz. He initiated a series of new constructions, including the Juyushi Mosque and the new city wall of Cairo, some of whose gates stand to this day. Badr's tenure saved the Fatimid regime, but also began a period where the vizierate was dominated by military strongmen who held power on their own, rather than through caliphal appointment, and who increasingly sidelined the caliphs to puppet rulers. Badr also initiated a wave of Armenian migration into Egypt, and was the first of a series of viziers of Armenian origin, who played a major role in the fortunes of the Fatimid Caliphate over the subsequent century.

## Early life and career in Syria

Badr was of Armenian ethnic origin, and born sometime between 1005 and 1008; he is recorded as being over 80 years of age at the time of his death. As his patroymic 'ibn Abdallah' indicates, he was most likely born into a Christian family and later converted to Islam. He was purchased as a military slave (mamluk or ghulam) by Jamal al-Dawla ibn Ammar, ruler of Tripoli, whence he acquired his epithet of 'al-Jamali'. His name, Badr, meaning 'full moon', is likewise typical for slaves. Otherwise his early life and career until c. 1063 are obscure. However, the historian Seta Dadoyan suggests that he may be identifiable with a namesake Abu'l-Najm Badr, a young Armenian ghulam who briefly ruled over Aleppo on behalf of the Fatimids in 1022. At some point, Badr married the daughter of Ruqtash, a Turkoman officer in the Fatimid army.

### First governorship of Damascus

Badr's career begins to be documented in April 1063, when he was appointed military governor of Damascus and its province in succession to al-Mu'ayyad Mu'tazz al-Dawla Haydara ibn al-Husayn. Badr is recorded at this point as bearing the honorific titles of 'Crown of Commanders' (Taj al-Umara), 'Commander of the Armies' (Muqaddam al-Juyush), and 'Honour of the Realm' (Sharaf al-Mulk). He made Mizza near Damascus his residence. According to Thierry Bianquis, Badr may have tried to exploit local rivalries to strengthen his position, by choosing as fiscal administrator Yahya ibn Zayd al-Zaydi, who hailed from one of the two powerful Husaynid ashraf families of the city, the other being the Banu Abi'l-Jinn family, that had previously held the post, along with that of qadi of Damascus.
Badr's tenure was cut short little more than a year later, in June/July 1064, after clashes between his troops and the local people and the urban militia (ahdath). Two other governors, Haydara al-Kutami and Durri al-Mustansiri, followed in short succession, but by the end of the year Damascus was left without governor for several months. The troubles in Syria were symptomatic of the wider crisis afflicting the Fatimid state, which during this period neared complete collapse. The weak rule of Caliph al-Mustansir (r. 1036–1094) had opened the central government to intrigues and rivalries; the vizierate was held by favourites of the Caliph's mother, Rasad, changing hands over thirty times between 1063–1067; and factional infighting between the different ethnic contingents of the Fatimid army broke out, crippling the administration and exhausting the treasury. Open clashes broke out in Cairo between the Turks and the black African troops (Sudan) favoured by Rasad in 1062 and again in 1067, when the Turks under Nasir al-Dawla Ibn Hamdan seized control of the capital and expelled their rivals to Upper Egypt.

### Second governorship of Damascus

On 3 July 1066, Badr returned to Damascus, not only as its governor, but of all of Syria, with the additional honorific of 'Sword of Islam' (Sayf al-Islam), and took possession of the Qasr al-Saltana fortress, located just outside the city walls, as his seat. Within a few days he learned of the death of his son, Sha'ban, at Acre.
In the meantime, Badr's second tenure in Damascus proved as troubled as the first, facing uprisings by the ahdath, whose motives are unclear. His persecution of the Banu Abi'l-Jinn is recorded, as well as the imprisonment or exile of several of the city's notables. Among the exiles was Abu Tahir Haydara ibn Ibrahim Ibn Abi'l-Jinn, who served as naqib al-ashraf (dean of the Alids) in Damascus. Abu Tahir went to Cairo to lodge complaint with Nasir al-Dawla Ibn Hamdan, who then held power in Egypt and was a declared rival of Badr. Ibn Hamdan tried to enlist Abu Tahir and the Bedouin tribes of the Syrian Desert in the cause of eliminating Badr; the latter had opposed the Bedouin tribes (Banu Tayy, Banu Kalb, and Banu Qays) who, taking advantage of the weakening of Fatimid authority, tried to seize lands in the Hawran Plain and Jordan River valley. Ibn Hamdan released Humayd and Hazim, two imprisoned members of the Banu'l-Jarrah, the leading family of the Tayy, gave them 40,000 gold dinars to kill Badr, and sent Abu Tahir along with them to Syria.
Badr was also unable to halt the collapse of the Fatimid state's authority in the region, specifically the Emirate of Aleppo. The chief city of northern Syria, Aleppo had become a Fatimid vassal c. 1009. After that, periods of direct Fatimid rule alternated with rule by the local Mirdasid dynasty; the last Fatimid attempt to recover direct control of the city was defeated in 1060 and marked the start of Fatimid decline in the region, although the Mirdasids continued to recognize nominal Fatimid suzerainty. Factinal conflict between members of the Mirdasid clan continued to plague Aleppo, however, until in 1065, Mahmud ibn Mirdas seized the city. In 1067, according to the 13th-century Damascene historian Sibt ibn al-Jawzi, Mahmud refused a demand by Caliph al-Mustansir (r. 1036–1094) to resume raids against the Byzantine Empire, render tribute and expel the Turkoman warrior band under Ibn Khan that had helped him gain Aleppo. Badr was instructed to bring Mahmud to heel, and turned to the latter's deposed uncle, Atiyya ibn Salih, promising him assistance to regain control of Aleppo. Atiyya marched on Aleppo, but the two Mirdasids were reconciled by Ibn Ammar of Tripoli, dividing the emirate between themselves and confirming their nominal allegiance to the Fatimid caliph. When Atiyya went to Damascus to join Badr, however, his stronghold, Rahba, was seized by the Uqaylid emir of Mosul, Muslim ibn Quraysh, who had the Friday prayer read in the name of the Abbasid caliph.
In March 1068, Badr had to abandon Qasr al-Saltana, although this may have been related to damages it suffered during the severe earthquake of that month. A letter from May 1068 at any rate describes Damascus as deprived of all government authority, the Qasr al-Saltana ransacked by the populace, and Badr having fled to Ascalon. He was replaced by Qutb al-Dawla Bariz Tughan (accompanied by Abu Tahir Ibn Abi'l-Jinn), likely invested as governor by Ibn Hamdan. Shortly after, in July 1068, Badr arrived with his troops and Bedouin auxiliaries before the city, but was unable to hold his position and had to retire to Ascalon. In his wake, the ahdath completed the destruction of the Qasr al-Saltana, the chief symbol of Fatimid rule over Damascus. Qutb al-Dawla and Abu Tahir did not succeed to restore order. The quarrels between the ahdath and the Fatimid soldiers continued, with Badr sending one of his officers to help the latter organize. Badr also bought off the Jarrahid Hazim for 10,000 dinars, while his cousin Humayd sought a similar arrangement. In the end, Qutb al-Dawla and Abu Tahir fled Damascus for Egypt after a few weeks, but were captured by the Tayy in Amman and sold to Badr for 12,000 dinars, rich vestments, and the grant of estates. Abu Tahir was paraded through Acre on a donkey, before being strangled and his corpse flayed. This humiliating death of one of the most distinguished Alids on Syria only served to increase the Damascenes' hatred of Badr.

### Badr in Acre

At the end of the 1060s, the Fatimid Caliphate seemed on the verge of collapse. In Egypt, poor harvests from a series of low Nile floods coupled with the anarchy and the depradations of the Turkish soldiery created a financial crisis and widespread famine. Caliph al-Mustansir was forced to sell his treasures to meet the Turks' extortionate demands, which did not prevent them from looting the Fatimid palaces and libraries and destroyeing much of the capital When one part of the Turks accused Nasir al-Dawla of not distributing the loot fairly, he was forced to flee to the Nile Delta, from where he appealed for aid to the Seljuk sultan, Alp Arslan (r. 1063–1072), and promised to restore Egypt to Abbasid and Sunni allegiance. In the same year, a century of Fatimid suzerainty over the Hejaz and the two holy cities of Mecca and Medina also ended, as the Sharif of Mecca also declared his submission to the Abbasids.
In Syria, Fatimid rule was already tentative, as the collapse of centralized authority had led to the establishment of isolated, regional centres of power. In the north, although the population of Aleppo itself was mostly Shi'ite and favourable to the Fatimids, the evident weakness of the Fatimid state and the mounting pressure of the Seljuk expansion, led Mahmud to recognize Abbasid suzerainty in 1070. In central Syria, Damascus was held by Abu Tahir's brother Muhtass al-Dawla, before power was seized by the Fatimid officer Mu'alla al-Kutami, whose father Haydara had served briefly as governor in 1064. Al-Kutami managed to hold on to power through a series of clashes involving the Maghrebi and Eastern contingents of the Fatimid garrison, the Damascenes, and the Banu Kalb. Confronted with the Damascenes' attempts to oust them from the city, al-Kutami and his Maghrebi followers turned to Badr, who formally confirmed al-Kutami as governor of Damascus. Ramla and coastal Palestine answered to Ibn Hamdan, while Badr held the coastal cities of Acre, Ascalon, Sidon, and Caesarea. Meanwhile, the qadis of Tyre, Ibn Abi Aqil, and of Tripoli, Ibn Ammar, supported by their cities' merchant aristocracies, ruled as de facto autonomous princes.
Badr aimed to subdue Tyre, which by virtue of its position cut his territories in half, but his first attack on the city was thwarted by the presence of al-Kutami's troops. After Badr and al-Kutami reconciled, Badr once more marched on Tyre. Ibn Abi Aqil turned to the Turkoman warlord Qaralu, who attacked Sidon with 6,000 men. Badr defeated him and returned to lay siege to Tyre. Ibn Abi Aqil then turned to Ibn Khan, who with his own Turkoman warband arrived before Tyre. To the consternation of Ibn Abi Aqil, the Turks began fraternizing with Badr's troops. When the ruler of Tyre had Ibn Khan assassinated in revenge, his men joined Badr's army. Badr was soon also joined by Turks from Egypt, opponents of Ibn Hamdan, who had once again seized control of Cairo. To secure his position, Ibn Hamdan tried to ensure that his powerful rival remained occupied in Syria. While Badr was engaged with besieging Tyre, Ibn Hamdan encouraged rebellions among the Bedouin tribes of the Banu Sanbas and Banu Tayy, installing his own brother Fakhr al-Arab as governor in Ramla to rally the opposition to Badr, as well as sending encouraging messages to al-Kutami, and even to Alp Arslan himself, inviting him to invade Syria and conquer it from the Fatimids. On 19 January 1071, the Seljuk ruler Alp Arslan crossed the river Euphrates into Syria to campaign against the Fatimids, before being hastily diverted north to fight the Byzantines at Manzikert.
Conversely, Badr recruited to his cause the Oghuz clan of the Nawikis, that was fleeing the onslaught of the Seljuks, to combat the Bedouin. Led by Atsiz ibn Uvaq, in 1071 some of these Turkomen captured Ramla and Jerusalem, which had been severely damaged by the 1068 earthquake. This may have initially been done at Badr's request, to root out the opposition being gathered there by Ibn Hamdan, but soon—possibly as the result of quarrels over the payments he received—Atsiz began acting as an independent ruler, and in late 1072/early 1073 acknowledged the suzerainty of the Abbasid caliph and the Seljuk sultan Malikshah in Baghdad. Atsiz launched repeated attacks on Damascus, still held by al-Kutami and his men, as well as Badr in Acre, before launching a raid into Egypt itself in 1072, devastating the Nile Delta.

## Vizierate
### Rise to power

In March/April 1073, Ibn Hamdan and his relatives were murdered by a rival Turkish commander, but this did not stop the factional infighting in Cairo. Al-Mustansir seized upon a drastic solution to his problems, and secretly called upon Badr for aid. The latter accepted, provided that he could bring him his Armenian troops with him. Although the sailing season was well past and the winter storms begun, Badr embarked his troops. His luck held, and thanks to uncommonly fair weather he arrived at Damietta in December 1073, catching everyone by surprise. He immediately exacted monetary levies from the merchants of Tinnis, and marched south on Qalyub. Unaware of the reason for Badr's arrival, the Turkish factions in Cairo did not suspect him of ill intentions. Badr and the caliph communicated in secret, leading first to the arrest of the Turkish commander Yaldakush. Badr himself arrived in Cairo alone, on the evening of 27 January 1074, and at first avoided any open signs of being in collusion with al-Mustansir. Instead he invited the Turkish commanders for banquets at his residence, where he gave them the impression that he scorned the caliph. In the meantime, Badr's troops joined him singly in Cairo so as not to arouse suspicion, until some 900 had gathered. At that point, Badr invited the rival officers to a sumptuous banquet, where they were assassinated.
Following this feat, al-Mustansir proclaimed Badr as vizier with a plenitude of powers and titles: as well as remaining commander-in-chief (Amir al-Juyush), he was also chief justice as 'Protector of the judges of the Muslims' (Kafil Qudat al-Muslimin), and head of the Isma'ili missionary network as 'Guide of the Missionaries of the Believers' (Hadi Du'at al-Mu'minin). Medieval Arabic authors describe his position as a "vizierate of the sword and the pen" (wizarat al-sayf wa'l-qalam) to highlight the fusion of military and civilian authority, or "vizierate with plenary powers" (wizarat al-tafwid), while modern historians term Badr a "military dictator". The military foundation of Badr's power was exemplified by the title of Amir al-Juyush (popularly mirgush), which not only became the name most commonly associated with him, but was also used by Badr as his proper patronymic. His private army, some 7,000 strong, formed the core of a new regiment, called the Juyushiyya, while his own properties and servants were designated with the adjective surname Juyushi.
The historian Heinz Halm argues that to all intents and purposes, Badr's position was analogous to that of sultan, adopted a few decades earlier by the Seljuk ruler Tughril Beg to frame his authority vis-à-vis the Abbasid caliph. Michael Brett on the other hand points out that the amplitude of powers vested in Badr was unprecedented, and included matters of religion, which properly belonged to al-Mustansir's sphere of authority as imam, as well as the dispensation of justice, a core attribute of sovereignty. Brett insists that Badr was not a "sultan coming in from the outside like Tughril Beg and Saladin, but an insider identified with the dynasty and its cause".

### Domestic governance

Once nominated as vizier, Badr began a purge, not only among the remaining Turkish officers, but also among the high officials. The vizierate alone had changed hands dozens of times during the preceding anarchy, and Badr executed many of its holders, as well as qadis. The confiscated properties of all the purged officers and officials helped replenish the empty caliphal treasury. Following the establishment of control over Cairo, in 1075 Badr proceeded to restore central control in the Nile Delta, where the Luwata Berbers had established their rule during the anarchy, gathering the harvest and hoarding it to drive up prices, without paying any taxes to the treasury or bothering to see to the upkeep of the vital irrigation systems. Badr proceeded to clear the Delta from east to west. Although the Luwata chieftain, Sulayman, had aided Badr when the latter landed in Egypt, both he and his son were killed, while Alexandria and Damietta were taken by storm. The re-establishment of Fatimid control over Upper Egypt proved more difficult, as the local Bedouin tribes defended the virtual independence they had gained over the previous years. Badr proceeded against them in summer 1076, taking the Bedouin by surprise in their camp at night and killing most of them, while others were pursued until they drowned in the Nile. Finally, Aswan, on the border with the Christian Nubian kingdom of Makuria, was captured, completing the conquest of the entirety of Egypt. The local autonomous ruler, Kanz al-Dawla, fled to the Nubians, but was handed over to Badr and executed in Cairo.
By 1076, Badr had restored the authority of the central government over Egypt, and the Caliph al-Mustansir was reduced to the purely ritual role as head of the Isma'ili community. Although Isma'ilism was restored as the official doctrine, Fatimid ceremonies were reduced, and Sunnis and other Shi'a communities were allowed to practice their faith. Badr retained overall control of religious affairs, and sponsored the building of both mosques and churches.
Badr also undertook a major administrative reform of Egypt. Until that time, the country had been divided in a large number (between 60 and 96) of small districts (kūra), which in some form or other dated to the pagarchiae of Greco-Roman Egypt. Badr abolished and replaced them with 23 provinces (14 in Lower Egypt and 9 in Upper Egypt), which in broad outlines survive to the present day. In addition, Badr encouraged the immigration of Armenians, Muslim and Christian alike, into Egypt. Badr also sponsored the Armenian Church, which became a serious rival to the Coptic Church and established its own, separate hierarchy. By the end of the century, the Armenian community in Egypt numbered almost 100,000 people, and was represented among the highest civil and military offices of Fatimid Egypt.

### Foreign policy and military activities
#### Syria

Badr's departure for Egypt had only increased the power vacuum in Syria, leaving the field open for increasing numbers of Turkoman warrior bands coming from the east. One such chieftain, Şöglü, captured Acre, where Badr had left his wife and children. Atsiz, who regarded himself by then as the overall leader of the Turkomans in Syria, demanded their handover, but Şöglü refused and sent them to Egypt. Shortly after Şöglü and Atsiz fought over possession of Tiberias, a struggle in which Atsiz emerged victorious. The inhabitants of Acre however pre-empted Atsiz' attack on them and called upon the Fatimid garrison of Tyre for protection. Thwarted at Acre, Atsiz turned on Damascus. Resistance was hampered by the rivalries between the local population and the Berber garrison, as well as the outbreak of famine in the city, which capitulated in June/July 1076.
Emboldened by his success, Atsiz gathered his forces and invaded Egypt in December 1076, raiding and laying waste to the area of the Nile Delta. Panic broke out in Cairo, where the populace thronged before the gates of the caliphal palaces, asking al-Mustansir to deliver them from the Turkomans. Badr, who had been campaigning in Upper Egypt, returned in haste north and busily recruited as many men as he could—including 3,000 Hajj pilgrims and defectors from Atsiz' army. In a battle north of Cairo in February 1077, Atsiz' army was heavily defeated, and he barely escaped with a remnant of his army into Palestine. Gaza and Ramla shut their doors against Atsiz, who had to withdraw to Damascus. Most of the cities of Palestine returned to Fatimid allegiance, including Jerusalem, where the inhabitants massacred the Turkomans of the garrison. The Turkoman chieftain was not finished, however; he recaptured Jerusalem, in turn massacring its inhabitants, restored his rule over Ramla, which was abandoned by its people, and punished Gaza by storming it and massacring its inhabitants. He then launched a raid into the borders of Egypt and captured the Fatimid-held port city of Jaffa, before returning to Damascus, declaring that next he would repeat his invasion of Egypt. Badr countered this threat by launching his own invasion of Syria, sending his general Aftekin al-Juyushi to attack Damascus. A first attempt in autumn 1077 or spring 1078 failed, but in summer 1078 the Fatimid army laid siege to the city. Atsiz sought assistance from Malikshah, who, displeased with the Turkoman's ineffectiveness, granted possession of Damascus to his younger brother, Tutush, as an appanage. When Tutush and his forces appeared before Damascus, the Fatimids withdrew to the coast. Atsiz surrendered Damascus to Tutush, only to be executed in September/October 1078.

#### Arabia

In 1075, the two holy cities, Mecca and Medina, that had for a time recognized the Abbasid caliphs, reverted to Fatimid suzerainty. In the same year, dissensions arose between Atsiz and his brothers. One of them, Mankli, made contact with Badr, and even restored the name of al-Mustansir in the Friday prayer in his territories around Acre. He did not last long against Atsiz, however, and was forced to flee to Rufaynah in the north. In October 1076, Atsiz marched against Egypt but Badr declared jihād against him. Defeated, Atsiz withdrew to Syria. In 1079, Badr sent his fellow Armenian, Nasr al-Dawla, against Atsiz in Damascus, while from the north the Seljuks under Tutush approached the city (October 1079). In the event, the Fatimids withdrew, and Damascus, along with most of Syria, fell to the Seljuks.

### Death and legacy

Badr died on 21 June 1094. Al-Mustansir tried to regain the powers he had ceded to him, but the majority of Badr's officers supported the succession of Badr's son al-Afdal as vizier.
Badr's position in the history of the Fatimid state is pivotal. While the fusion of administrative and judicial powers in the person of the vizier was the culmination of a process already evident under previous holders, Badr was the first military man to rise to the vizierate ("vizier of the sword") under the Fatimids, and furthermore owed his position not to the Caliph, but to the support of a private military force, personally loyal to him. In this Badr also set the tone for his successors: until the end of the Fatimid regime in 1171, the vizierate was held mostly by military strongmen, who sidelined the caliphs and were the de facto rulers of the state. Many of these strongmen were Armenian, like Badr: Badr with his son al-Afdal and grandson Kutayfat provided a "miniature dynasty" of viziers, and three more Muslim Armenian viziers would follow until the assassination of the last of them, Ruzzik ibn Tala'i, in 1163. During this "Armenian period" in the history of Fatimid Egypt, the Armenians provided the mainstay of the Fatimid dynasty.

## Buildings

In the 1080s, to protect the city from possible Seljuk attack, Badr ordered the refortification of Cairo. The old mud brick walls, built when Cairo had been founded in the 970s, were entirely replaced by a new stone fortification, supervised by builders from northern Syria. Three of the gates of Badr's city wall still stand to this day (Bab al-Futuh, Bab al-Nasr, and Bab Zuweila), as well as a section of the northern city wall. He also built the Juyushi Mosque on the Muqattam Hill, in memory of his son al-Awhad, who rebelled in Alexandria and was killed in 1085. Among the most notable surviving wood art objects from the Fatimid period is also the minbar commissioned by Badr for the shrine of the head of Husayn ibn Ali in Ascalon (now located at the Ibrahimi Mosque in Hebron; see Minbar of the Ibrahimi Mosque).