Fatimid invasion of Egypt (919–921)

The second Fatimid invasion of Egypt occurred in 919–921, following the failure of the first attempt in 914–915. The expedition was again commanded by the Fatimid Caliphate's heir-apparent, al-Qa'im bi-Amr Allah. As during the previous attempt, the Fatimids captured Alexandria with ease. However, while the Abbasid garrison in Fustat was weaker and mutinous due to lack of pay, al-Qa'im did not exploit it for an immediate attack on the city, such as the one that had failed in 914. Instead, in March 920, the Fatimid navy was destroyed by the Abbasid fleet under Thamal al-Dulafi, and Abbasid reinforcements under Mu'nis al-Muzaffar arrived at Fustat. Nevertheless, in the summer of 920, al-Qa'im was able to capture the Fayyum Oasis, and in the spring of 921, extend his control over much of Upper Egypt as well, while Mu'nis avoided an open confrontation and remained at Fustat. During that time, both sides were engaged in a diplomatic and propaganda battle, with the Fatimids' in particular trying to sway the Muslim populace to their side, without success. The Fatimid expedition was condemned to failure when Thamal's fleet took Alexandria in May/June 921; when the Abbasid forces moved on Fayyum, al-Qa'im was forced to abandon it and flee west over the desert.

Background
The Fatimid dynasty arrived to power in Ifriqiya in 909, when they overthrew the reigning Aghlabid dynasty with the support of the Kutama Berbers. In contrast to their predecessors, who were content to remain a regional dynasty in the western fringes of the Abbasid Caliphate, the Fatimids held ecumenical pretensions: as imams of the Isma'ili Shi'a sect, and claiming descent from Fatima, the daughter of Muhammad and wife of Ali, they regarded the Sunni Abbasids as usurpers and were determined to overthrow them and take their place. Thus, in early 910, the Fatimid imam, Abdallah, declared himself caliph with the regnal name of al-Mahdi Billah ((r. 909 – 934)).

In line with this imperial vision, following the establishment of their rule in Ifriqiya, the Fatimid Caliphate's next objective was Egypt, the gateway to the Levant and Iraq, the seat of their Abbasid rivals. A first invasion in 914–915 under the Fatimid heir-apparent al-Qa'im bi-Amr Allah captured Cyrenaica, Alexandria and the Fayyum Oasis, but failed to take Fustat. Following the arrival of reinforcements from Syria and Iraq under Mu'nis al-Muzaffar, al-Qa'im retreated to Ifriqiya. In the aftermath of his retreat, Cyrenaica was lost again.

Recovery of Cyrenaica
Despite their failure, the Fatimids immediately began to make plans for a second assault on Egypt, starting with the recapture of Cyrenaica. This was accomplished with the surrender of the regional capital, Barqa, after an 18-month siege, in April 917. The punishment meted out on the city's population was harsh, and many fled in droves to Alexandria. The Abbasid governor of Egypt, Dhuka al-Rumi, reinforced the garrison of the latter city.

The Fatimids evidently had sympathizers in Egypt, as the Egyptians, since the early 9th century, had come to resent rule from Baghdad; Dhuka was forced to execute several people for corresponding with al-Mahdi and his son, al-Qa'im. In 904, al-Mahdi and his family had sought refuge in Egypt after their flight from Syria, and had remained in hiding with sympathizers in Fustat for about a year. In addition, the success of the pro-Fatimid, Isma'ili missionary movement (daʿwa) is attested in a marked rise in pro-Shi'a, or specifically Isma'ili, inscriptions among Egyptian tombstones in the decades after c. 912.

Invasion of Egypt
The second invasion of Egypt is known mostly from Sunni sources, which are hostile to the Fatimids. The expedition began on 5 April 919, when al-Qa'im set out from the palace city of Raqqada, at the head of his army.

Capture of Alexandria and Dhuka's fortification of Giza
The vanguard arrived before Alexandria on 9 July 919, while the main body under al-Qa'im, came in September/October. The arrival of the Fatimid expeditionary force in July 919 caught the city's governor, Dhuka's son Muzaffar, by surprise. Along with his aides and many of the populace, he fled without giving battle. Having already once acknowledged Fatimid sovereignty and hence now considered in revolt, the city was sacked by the Fatimid troops.

The situation for Dhuka al-Rumi was critical: unlike the previous Fatimid invasion, when the population had largely stood behind the efforts to defend Fustat and armed itself for battle, now panic spread, and those who had the means fled the country into the Levant. At the same time, the garrison proved unwilling to fight for lack of pay; indeed, many officers absconded with their units to Palestine.

As in 914, Dhuka concentrated his few forces at Giza, across the Nile from Fustat, where the pontoon bridge gave access to Rawda Island and the city itself. There he fortified the bridgehead, erecting a fort and a fortified encampment for his troops. Soon after, however, the new fiscal administrator for Egypt, al-Husayn al-Madhara'i, arrived with sufficient funds to pay the regular troops their arrears. On 11 August, Dhuka died, and his predecessor Takin al-Khazari was chosen to succeed him; he did not arrive in Fustat until January 920, whereupon he ordered a second ditch dug around the camp at Giza.

Abbasid reaction and the naval victory of Thamal
Unlike in 914, however, al-Qa'im made no move to exploit the weakness of the Fustat garrison and storm Giza, even though several key figures, including the former Tulunid vizier, Abu Bakr Muhammad ibn Ali al-Madhara'i, corresponded with him. Instead, he remained at Alexandria for the remainder of the year, as reinforcements continued to arrive. These included the Fatimid fleet, 80 ships strong under the eunuch Sulayman. The Abbasid court also mobilized its forces at the news of the Fatimid invasion; once again, Mu'nis al-Muzaffar was entrusted with the high command, leaving Baghdad on 23 February 920.

More importantly, the fleet of Tarsus, under Thamal al-Dulafi, was given orders to sail to Egypt. Thamal, with his 25 ships carrying Greek fire, arrived in time to prevent the Fatimid ships from entering the Rosetta branch of the Nile, and on 12 March, near Abukir, he inflicted a crushing defeat on the Fatimid fleet, whose vessels were driven to the shore by the wind. Most of the Fatimid crews were either killed or captured. The prisoners were brought to al-Maqs on the Nile, where Takin released most of the ordinary sailors, while admiral Sulayman and 117 of his officers paraded around publicly in Fustat. The Kutama and the black African guardsmen ('Zawila'), some 700 men in total, were delivered to the mob to be lynched.

On 25 May, Mu'nis arrived in Fustat, and with his 3,000 men took position at Giza. Further detachments were sent north, up to Damanhur in the northwestern Nile Delta, which was held by Muhammad ibn Tughj, as well as south, to prevent a possible advance of the Fatimids into Upper Egypt.

Fatimid capture of Fayyum and Upper Egypt and stand-off with Mu'nis
Indeed, al-Qa'im, pressed for supplies in Alexandria, decided to repeat the manoeuvre of 914: on 30 July he left Alexandria and, bypassing Giza, took over the fertile Fayyum Oasis, which could provide provisions and a base of operations. As before, he proceeded to tax the inhabitants, as if he were the rightful ruler of Egypt.

In Alexandria he left behind Fath ibn Ta'laba, with orders to construct numerous catapults (manjaniq and 'arrada) to protect the city harbour from a naval attack by Thamal's fleet. Mu'nis did not oppose this move, since his forces were inadequate to confront the Fatimids in open battle, and he was facing difficulties in providing the salary of his troops. Furthermore, when the commander he had sent to Upper Egypt died in spring 921, the Kutama were easily able to take over the entire region, up to the Coptic bishopric of al-Ushmuniyya. Not only did this increase the area under taxation for al-Qa'im, but it also ended the grain supply of Fustat from there.

For an entire year, both sides avoided open conflict, and engaged rather in a diplomatic and propaganda battle. Mu'nis offered promises of safe-conduct (aman), as well as recognition of the Fatimids as autonomous rulers of Ifriqiya in the style of the Aghlabids, if al-Qa'im submitted to the Abbasid caliph. Al-Qa'im rejected these overtures in a letter that reiterated the Fatimids' claims to universal dominion as the rightful heirs of Muhammad. A fragment of a long poem exhorting the inhabitants of Fustat to emulate the "westerners" and follow the rightful Fatimid da'wa also survives; Mu'nis sent a copy to Baghdad, where the scholar al-Suli was commissioned to compose a reply. His riposte to the Fatimids' pretensions was considered so successful that Caliph al-Muqtadir gave him 10,000 dinars in reward.

Al-Qa'im also kept up his correspondence with the former vizier al-Madhara'i, who informed him about the Fustat garrison's weakness, but may have played a double game, trying to delay an attack until fresh Abbasid troops arrived. At the same time, the Fatimid commander sent appeals to the two holy cities of Islam, Mecca and Medina, urging them to recognize the Fatimids' claims to sovereignty over the Islamic world. His requests were ignored.

Abbasid recovery of Alexandria and Fayyum, retreat of al-Qa'im
Finally, in late spring 921, while Mu'nis sent one of his officers to attack towards Fayyum, Thamal with his fleet sailed down the Nile to Alexandria. The city was captured with relative ease from its Kutama garrison (May/June 921), who left much of their stores and equipment behind. Thamal evacuated the city's inhabitants to Rosetta, and then followed with his fleet.

On 28 June, Mu'nis and Takin, along with Thamal's fleet, set out with all their forces to attack Fayyum. Together, the Abbasid army and fleet blockaded the sole connection of Fayym with the Nile at Illahun, cutting al-Qa'im and his men in the oasis from the rest of the country. Once the Abbasid forces began to advance into the oasis, on 8 July al-Qa'im ordered the retreat: all heavy equipment was left behind, while he and his men made their way through the desert to the coastal road to Barqa, an arduous march in which many perished.

Aftermath
The renewed failure of the second invasion of Egypt was a considerable embarrassment to the Fatimids. Fatimid apologists tried to explain the failure as part of the divine plan for the god-guided dynasty; the fragmentary Sirat al-Imam al-Mahdi claims that al-Qa'im returned "undefeated" from Egypt, while the chief Fatimid spokesman later in the century, al-Qadi al-Nu'man, insisted that al-Mahdi, with his divine foreknowledge, knew that his son would be defeated, but that the campaign had been necessary to announce the Fatimids' intentions, prove their zeal in carrying out the jihad, and propagate their da'wa.

For a few years, the Fatimids continued to launch attacks from Barqa into Egypt: in 922 and 928, Fatimid troops fought Abbasid troops at Dhat al-Himam, some 60 km west of Alexandria, while in 923, another Fatimid commander raided one of the oases of the Western Desert (likely Dakhla Oasis) and laid waste to it, before the outbreak of a disease forced him to retreat.

Apart from a brief intervention in the internal conflicts of the military factions in Egypt in 935, however, a serious attempt at a conquest was not undertaken for many years. It was not until 969, when the balance of power had shifted much more decisively in favour of the Fatimids, that another large-scale invasion was undertaken. By then, the Abbasid Caliphate, weakened by constant power struggles between rival bureaucratic, court, and military factions, and deprived of its outlying provinces to ambitious local dynasts, had ceased to exist as a political entity, with the Abbasid caliphs reduced to powerless pawns of the Buyids. At the same time, the Fatimid regime had grown stronger and far more wealthy, and now disposed of a large and disciplined army. This time the Fatimids met little resistance, and Egypt was conquered. In 972, the Fatimid court moved to Egypt and established itself at a new capital, Cairo, north of Fustat.