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 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.
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.
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.
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.
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.
[13][14] 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.
[22] 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.
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.
[50][51] 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.
[58] In 904, the eventual first Fatimid caliph had sought refuge in Egypt, then ruled by the autonomous Tulunid dynasty, and had remained in hiding with sympathizers in Fustat for about a year, until the Abbasids recovered control of the province in early 905.
Their presence has puzzled modern historians: some see them as an error, or an anticipation of the eventual conquest, but others consider them a deliberate provocation and part of the psychological warfare the Fatimids engaged in against the Ikhshidid regime.
[66] The Ikhshidid establishment was thoroughly penetrated; some Turkish commanders are reported to have written to al-Mu'izz inviting him to conquer Egypt,[67] while even Ibn al-Furat is suspected by some modern historians to have joined the pro-Fatimid party.
[56] The army assembled was reported by Arab sources to have numbered over a hundred thousand men,[71] and was to be accompanied by a strong naval squadron,[d] and a war treasury of over 1,000 chests filled with gold.
Conversely, Lev points to the career of Muhammad ibn Tughj al-Ikhshid, and Jawhar's own success in 969, as evidence that "the conquest of the centre determined the fate of the country, although the provinces were not totally subjugated".
[77][79] The leader of the Ikhshidiyya, Nihrir al-Shuwayzan, being in command of the only sizeable military body, requested in addition that he be nominated as governor of the holy cities of Mecca and Medina, a demand that Lev dismisses as "unrealistic" and revealing a "complete lack of understanding for the Fatimid particular religious sensitivities.
[88] On the Egyptian side, Nihrir was chosen as common commander of the Ikhshidiyya and the Kafuriyya,[90] who on 28 June occupied Rawda Island, which controlled passage over the pontoon bridge that connected Fustat with Giza on the western shore of the Nile, where Jawhar had set up camp.
[97] On 6 July, Ibn al-Furat and Abu Ja'far Muslim, accompanied by the leading merchants, led a crowd over the pontoon bridge to pay homage to Jawhar at Giza.
[97] On 9 July, Jawhar led the Friday prayer in the Mosque of Amr in Fustat, where the Sunni preacher, dressed in Alid white and reading the unfamiliar phrases from a note, recited the khuṭba in the name of al-Mu'izz.
[29][97] The Ikhshidid remnants gathered in Palestine under al-Hasan ibn Ubayd Allah, while further north, the Byzantines captured Antioch after a long siege and forced the Hamdanids of Aleppo into vassalage.
[98][99] The Fatimid troops defeated and captured al-Hasan ibn Ubayd Allah in May 970, but the inhabitants of Damascus were enraged by the unruliness of the Kutama soldiers and resisted until November 970, when the city capitulated and was pillaged.
His tasks were to restore an orderly government, stabilize the new regime, confront the remnants of the defeated Ikhshidid troops, and extend Fatimid rule to the north (the Nile Delta area) and south (Upper Egypt).
[120] This led to the consolidation of the separation of the Isma'ili Kutama and the Fatimid apparatus from the Sunni populace of Fustat with the erection of a new palace city (that would become Cairo) at the site of Jawhar's army encampment.
[116] At some point thereafter, Jawhar also sent the da'i Ibn Salim al-Aswani as an envoy to the Christian kingdoms of Nubia, to renew the treaty regulating trade and tribute (baqt) and to demand—without success—the conversion of the Nubian kings to Islam.
The marshy terrain and the complex social and religious divisions in the local population were unfamiliar to his Kutama, so that Jawhar initially entrusted former Ikhshidid officers with operations as well.
Muzahim ibn Ra'iq, who with his men had submitted to the Fatimids, was appointed governor of Farama, and the former Ikhshidid commander Tibr was sent against Tinnis, where a revolt against heavy taxation had broken out.
[109][125][126] Nevertheless, this delayed the Qarmatian attack on Fustat for two months, and gave Jawhar time to prepare a line of fortifications and a trench at Ayn Shams, north of the capital, stretching for 10 kilometres (6 mi) from the Nile to the Muqattam hills.
[133] However, the disastrous campaign into Syria, the repulse of the Qarmatian invasion, the continued process of pacifying Egypt, and the construction of a new capital, entailed an enormous expenditure of manpower and financial resources.
Ignoring Fustat and the festive reception organized for him there, he went straight for his new capital, which he renamed as al-Qāhira al-Muʿizzīya ("the Victorious City of al-Mu'izz"), a name which in English was corrupted to Cairo.