Troops of the Fatimid Caliphate under the general Jawhar captured Egypt, then ruled by the autonomous Ikhshidid dynasty in the name of the Abbasid Caliphate, in 969.
The Fatimids launched repeated invasions of Egypt soon after coming to power in Ifriqiya (modern Tunisia and eastern Algeria) in 909, but failed against the still-strong Abbasid Caliphate. By the 960s, however, while the Fatimids had consolidated their rule and grown stronger, the Abbasid Caliphate had collapsed, and the Ikhshidid regime was facing prolonged crisis: foreign raids and a severe famine were compounded by the death in 968 of the strongman Abu al-Misk Kafur. The resulting power vacuum led to open infighting among the various factions in Fustat, the capital of Egypt. The atmosphere of crisis was deepened by the simultaneous advances of the Byzantine Empire against the Muslim states of the Eastern Mediterranean. Meanwhile, Fatimid agents operated openly in Egypt, and the local elites increasingly came to accept and even welcome the prospect of a Fatimid takeover in hopes of ending the instability and insecurity.
Faced with this favourable situation, the Fatimid caliph al-Mu'izz li-Din Allah organized a large expedition to conquer Egypt. Led by Jawhar, the expedition set off from Raqqada in Ifriqiya on 6 February 969, and entered the Nile Delta two months later. The Ikhshidid elites preferred to negotiate a peaceful surrender, and Jawhar issued a writ of safe-conduct (amān), promising to respect the rights of the Egyptian notables and populace and take up the jihād against the Byzantines. The Fatimid army overcame the attempts of the Ikhshidid soldiery to prevent its crossing of the Nile river between 29 June and 3 July, while in the chaos pro-Fatimid agents took control of Fustat and declared its submission to al-Mu'izz. Jawhar renewed his amān and took possession of the city on 6 July, with the Friday prayer read in the name of al-Mu'izz on 9 July.
For the next four years Jawhar served as viceroy of Egypt, quelling rebellions and beginning the construction of a new capital, Cairo. His attempts to expand into the former Ikhshidid domains in Syria, and even attack the Byzantines, backfired: after swift initial progress, the Fatimid armies were destroyed, and Egypt itself faced a Qarmatian invasion that was fought off just north of Cairo. Al-Mu'izz arrived in Egypt in 973, and took up residence in Cairo, which became the seat of the Fatimid Caliphate for the remainder of its existence, until the abolition of the Fatimid regime by Saladin in 1171.
Background: initial Fatimid attempts to capture Egypt
The Fatimid dynasty came to power in Ifriqiya (modern Tunisia and northeastern Algeria) in 909. The Fatimids had fled their home in Syria a few years before, and made for the Maghreb, where their agents had made considerable headway in converting the Kutama Berbers to the Fatimid-sponsored Isma'ili branch of Shi'a Islam. While the Fatimids remained hidden, the Isma'ili missionary Abu Abdallah al-Shi'i led the Kutama to overthrow the reigning Aghlabid dynasty, allowing the Fatimid leader to reveal himself publicly and declare himself caliph with the regnal name of al-Mahdi Billah (r. 909–934). In contrast to their predecessors, who were content to remain a regional dynasty on the western fringes of the Abbasid Caliphate, the Fatimids held ecumenical pretensions: claiming descent from Fatima, the daughter of Muhammad and wife of Ali, the Fatimid caliphs were simultaneously the leaders of the Isma'ili sect, whose followers accorded them semi-divine status as imams, the lawful vicegerents of God on earth. Consequently, the Fatimids regarded their rise to power as the first step in the restoration of their rightful place as leaders of the entire Muslim world against the usurping, pro-Sunni Abbasids, whom they were determined to overthrow and replace.
In line with this imperial vision, following the establishment of their rule in Ifriqiya, the next objective was Egypt, the gateway to the Levant and Iraq, the seat of their Abbasid rivals. In 914, a first invasion under the Fatimid heir-apparent al-Qa'im bi-Amr Allah was launched eastwards. It captured Cyrenaica (Barqa), Alexandria and the Fayyum Oasis, but failed to take the Egyptian capital, Fustat, and was driven back in 915, following the arrival of Abbasid reinforcements from Syria and Iraq. A second invasion was undertaken in 919–921. Alexandria was again captured, but the Fatimids were repelled in front of Fustat and their navy was destroyed. Al-Qa'im moved to the Fayyum Oasis, but was forced to abandon it in the face of fresh Abbasid troops and to retreat over the desert to Ifriqiya.
The failure of these early invasion attempts was chiefly due to the overextension of Fatimid logistics, and the concomitant failure to achieve decisive success before the arrival of Abbasid reinforcements. Nevertheless, Barqa was left in Fatimid hands as a forward base from which to threaten Egypt. As the Abbasid Caliphate entered a severe and general crisis in the 930s, the Fatimids once more tried to take advantage of the ensuing conflicts between the military factions in Egypt in 935–936. Fatimid forces briefly occupied Alexandria, but the actual victor of this affair was Muhammad ibn Tughj al-Ikhshid, a Turkish commander who established himself as the ruler of Egypt and southern Syria—ostensibly on the Abbasids' behalf but for all practical purposes independent—and founded the Ikhshidid dynasty. During his subsequent disputes with Baghdad, al-Ikhshid did not hesitate to seek Fatimid support, even suggesting a marriage alliance between one of his sons and a daughter of al-Qa'im, but after the Abbasid court recognized his rule and titles, he dropped this proposal.
On the Fatimid side, by the late 930s the initial revolutionary élan that had brought the Fatimids to power had faded, and although the claims to universal sovereignty were not forgotten, they were put on hold due to the outbreak of the large-scale revolt of the Khariji Berber preacher Abu Yazid (943–947). This rebellion almost brought the Fatimid regime to collapse, and even after its suppression, the Fatimids were for some time preoccupied with restoring their position in the western Mediterranean. During this time, Egypt was left in relative peace. Following the death of al-Ikhshid in 946, power passed to the strongman Abu al-Misk Kafur, a black eunuch slave whom al-Ikhshid had appointed as commander-in-chief of the army. For twenty years, Kafur was content to be the power behind the throne, as al-Ikhshid's sons ruled as emirs, but in 966 he assumed the throne in his own right.
Changing circumstances: Egypt in the 960s
During the second third of the 10th century, the balance of power shifted in the Fatimids' favour: while the Fatimids consolidated their regime, the Abbasid Caliphate was weakened by constant power struggles between rival bureaucratic, courtly, and military factions. Gradually deprived of its outlying provinces by ambitious local dynasts and reduced to Iraq, after 946, the Abbasid caliphs themselves were reduced to powerless pawns of the Buyids.
By the 960s, the Ikhshidids were also facing a crisis, a combination of domestic tensions and external pressures. The Christian Nubian kingdom of Makuria launched invasions of Egypt from the south, while in the west, the Lawata Berbers occupied the region around Alexandria, and allied themselves with local Bedouin tribes of the Western Desert to confront the Ikhshidid troops. In Syria, increasing Bedouin restiveness challenged Ikhshidid rule, especially as it coincided with an invasion of Syria by the Qarmatians, an Isma'ili sect based in Bahrayn (Eastern Arabia). Frequently allied with the Bedouin, the Qarmatians raided the caravans of merchants and Hajj pilgrims alike, with the Ikhshidids unable to counter their attacks. The situation was such that the overland routes from Egypt to Iraq were practically cut. Modern scholars have suspected the hand of the Fatimids behind at least some of these events: according to the French Orientalist Thierry Bianquis, the Makurian raid of 956, which pillaged the area of Aswan, was "probably supported covertly by the Fatimids", and a Fatimid collusion in the Bedouin and Qarmatian attacks in Syria has been "usually supposed", but, as the historian Michael Brett cautions, there is "no real evidence" to that effect.
The domestic situation in Egypt was worsened by a series of low Nile floods beginning in 962. In 967, the flood reached the lowest level recorded during the entire early Islamic period, followed by three years when the level of the river remained well below normal. Hot winds and locust swarms also did much to destroy crops, ushering in the worst famine in living memory, aggravated further by the outbreak of a rat-borne plague. Consequently, food prices rose rapidly: by 968, a chicken was to be had at 25 times its pre-famine price, and an egg at fifty times. The capital, Fustat, suffered most heavily. The most populous city in the Islamic world after Baghdad, it was ravaged by famine and outbreaks of epidemics (which continued into the early years of Fatimid rule). The poor harvests also reduced the revenue flowing into the treasury, leading to cuts in spending. This directly affected the influential religious circles; not only were their salaries left unpaid, but the money for the upkeep of the mosques vanished, and the inability to provide the men and money necessary to guarantee their security meant that after 965, the Hajj caravans ceased altogether.
Furthermore, the 960s saw the Byzantine Empire under Nikephoros II Phokas (r. 963–969) expand at the expense of the Islamic world, capturing Crete, Cyprus, and Cilicia, and advancing into northern Syria. The Ikhshidid regime's response to this advance was hesitant and ineffective: after doing nothing to help Crete, the fleet sent in response to the fall of Cyprus was destroyed by the Byzantine navy, leaving the coasts of Egypt and Syria defenceless. The Egyptian Muslims clamoured for jihād and launched anti-Christian pogroms that were suppressed with difficulty. Fatimid propaganda was quick to exploit the Byzantine offensive, contrasting the ineffectiveness of the Ikhshidids and their Abbasid suzerains with the Fatimids, who at the time were successfully fighting with the Byzantines in southern Italy, as vigorous champions of Islam. The Byzantine advance, coupled with the contemporaneous depredations of the Bedouin and Qarmatians in central Syria, also served to deprive Egypt of Syrian wheat, its usual resort during famines.
Against this backdrop of internal problems and external threats, and following the permanent decline of their former imperial overlords, the possibility of a Fatimid takeover became an increasingly more attractive prospect to the Egyptians.
Collapse of the Ikhshidid regime
The death of Abu al-Misk Kafur in April 968, without leaving an heir, paralyzed the Ikhshidid regime. Kafur's vizier, Ja'far ibn al-Furat, who was married to an Ikhshidid princess and may have entertained hopes for their son to sit on the throne, tried to control the government, but lacked a power-base outside the bureaucracy; while the army was divided into mutually antagonistic factions (chiefly the Ikhshidiyya, recruited by al-Ikhshid, and the Kafuriyya, recruited by Kafur). The military leaders would have preferred that one of their own succeed Kafur, but were forced to back down in the face of the Ikhshidid family and the opposition of the civilian and religious establishments.
The various factions initially agreed on a pact to share power under the nominal rule of al-Ikhshid's 11-year-old grandson, Abu'l-Fawaris Ahmad ibn Ali, with his uncle al-Hasan ibn Ubayd Allah, the governor of Palestine, as regent, Ibn al-Furat as vizier, and the slave-soldier (ghulām) Shamul al-Ikhshidi as commander-in-chief. The pact quickly unravelled, as the personal and factional rivalries of the Ikhshidid elites came to the fore. Shamul lacked any real authority over the army, so that the Ikhshidiyya clashed with and expelled the Kafuriyya from Egypt. At the same time, Ibn al-Furat began arresting his rivals in the administration, thereby effectively bringing government and, crucially, the flow of tax revenue, to a halt. The regent al-Hasan ibn Ubayd Allah arrived from Palestine in November and occupied Fustat, imprisoning Ibn al-Furat; but his efforts to establish his authority failed, and in early 969 he abandoned the capital and returned to Palestine, leaving Egypt effectively without government.
The historian Yaacov Lev writes that faced with this impasse, the Egyptian elites were left only "with the choice of seeking outside intervention". Given the international situation at the time, this could only mean the Fatimids. The medieval sources report that letters from civilian and military leaders alike were sent to the Fatimid caliph al-Mu'izz li-Din Allah (r. 953–975) in Ifriqiya, where preparations for a new invasion of Egypt were already in full swing.
Fatimid preparations
The first years of the reign of al-Mu'izz were dedicated to expanding his rule over the western Maghreb and in the conflict with the Byzantines in Sicily and southern Italy, but it is clear, according to historian Paul E. Walker, that al-Mu'izz "intended the conquest of Egypt from early in his reign". Already in 965/6, al-Mu'izz began storing provisions and making preparations for a new invasion of Egypt. By that time, his armies under Jawhar had triumphed over the Umayyads of the Caliphate of Córdoba, reversing their gains and restoring Fatimid authority over what is now western Algeria and Morocco, territories that had been originally conquered by Fatimid generals in the 910s and 920s. In Sicily, the Fatimid governors captured the last Byzantine strongholds, thereby completing the Muslim conquest of the island, and defeated a Byzantine expedition sent in response. Following these successes, a truce was concluded with Constantinople in 967, leaving both powers free to pursue their designs in the East: the Byzantines against the Hamdanid Emirate of Aleppo, and the Fatimids against Egypt. The Fatimid caliph made no secret of his ambition, even boasting to the Byzantine ambassador during the negotiations that the next time they met would be in Egypt.