Medieval Egypt. Egypt entered the medieval Islamic world with the Arab conquest of 639-642, when Amr ibn al-As took the Byzantine province and founded the garrison city of Fustat beside the Roman fortress at the head of the Delta. For three centuries Egypt was a rich province of the caliphates, its grain feeding Arabia, its taxes enriching Damascus and Baghdad, its Coptic Christian majority slowly and unevenly adopting Arabic and Islam. When the Abbasid grip weakened in the ninth century, Egypt broke away under Ahmad ibn Tulun, a Turkish officer who built his own army and his great mosque in his new suburb of Cairo, the oldest mosque in Egypt surviving in its original form.
The Tulunid house did not last: in 905 the Abbasids retook Egypt by force, but direct rule again gave way to a second autonomous dynasty, the Ikhshidids. In 935 the caliph appointed Muhammad ibn Tughj, a Central Asian officer who took the old princely title al-Ikhshid, as governor; he soon ruled Egypt, the Delta and the Valley, and even the holy cities of the Hijaz, in the caliph's name but very much in his own interest, defending the country against the rising Fatimids to the west and husbanding its revenues. After his death in 946, his sons reigned while real power passed to their tutor, the eunuch Kafur, an able administrator who held Egypt together through famine and frontier attacks, and whose court drew the poet al-Mutanabbi, until Kafur's death in 968. Within a year the Fatimids marched in almost unopposed, and Egypt entered its Fatimid century. The Ikhshidid interlude matters because it fixed the pattern: Egypt was now a prize that strong governors held for themselves, the era of the independent states had firmly begun, and in 969 Egypt would become an empire's capital.
The Fatimids, a Shia dynasty claiming descent from the Prophet's daughter Fatima, conquered Egypt from North Africa and founded al-Qahira, the Victorious, Cairo, as their royal city. For two centuries Fatimid Egypt was among the wealthiest states on earth. The Fatimids ruled as Ismaili Shia imam-caliphs, rivals to Baghdad, over a population of Sunni Muslims, Coptic Christians, and Jews whom they generally treated with notable tolerance; Christians and Jews rose high in their administration. They built the al-Azhar mosque in 970, which grew into one of the oldest universities in the world, and their merchants dominated the trade between the Mediterranean and the Indian Ocean that made Egypt rich. Decline came in the eleventh century through famine, faction, and military strife, and the Crusader arrival in the Levant drew Egypt into holy war.
In 1171 Saladin, a Kurdish officer serving the Syrian ruler Nur al-Din, ended the Fatimid caliphate, restored Sunni Islam, and founded the Ayyubid dynasty. Saladin united Egypt and Syria, defeated the Crusaders at Hattin in 1187, and recovered Jerusalem, becoming the medieval world's model of chivalrous Muslim kingship, admired even by his enemies. His Ayyubid heirs relied increasingly on mamluks, slave-soldiers imported as boys from the Turkic steppes, converted, and trained as an elite cavalry. In 1250 the mamluks seized power themselves, founding a military sultanate that would rule Egypt and Syria for 267 years, and in 1260 at Ain Jalut they defeated the Mongols, the first lasting check on the Mongol tide, then expelled the last Crusaders from the mainland. Under the Mamluks, medieval Egypt reached its last and greatest flowering. Each dynasty left its stamp on Cairo's stones, so that the medieval city is still readable.
The Tulunids' mosque of Ibn Tulun, with its spiral minaret, the only one of its kind in Egypt, stands from the ninth century. The Fatimids built walled Cairo itself, with its palaces, its gates of Bab Zuweila and Bab al-Futuh, and al-Azhar, founded as the mosque of the new city and staffed to teach Ismaili doctrine to a Sunni land. Fatimid tolerance was policy and interest together: the dhimmi communities were numerous and useful, and the Geniza documents show Jewish merchants trading from Spain to India under Fatimid protection, while Coptic scribes staffed the financial bureaus as they had since Roman times.
Saladin's rule was brief but transformative: he ended the Shia caliphate, restored Sunni Islam, founded the madrasas that spread its law schools, and built the Citadel that crowned Cairo for seven hundred years, while his wars against the Crusaders, crowned by the recovery of Jerusalem in 1187, made him a hero of Islamic memory. The Ayyubid princes he left behind quarreled and invited disaster, and it was the Mamluks who answered the age's two existential tests: they stopped the Mongols at Ain Jalut in 1260, a battle that saved Cairo, Mecca, and the Islamic heartlands, and they drove the last Crusaders from Acre in 1291. Sultan Baybars organized the empire that followed: he refortified the coast, restored the caliphate as a shadow institution in Cairo, built a postal relay, and dealt as an equal with the Mongols of the Golden Horde and the kings of Europe.
The fourteenth century under al-Nasir Muhammad was the sultanate's zenith, when Cairo, with perhaps half a million people, was among the largest cities in the world and the leading city of the Islamic world.
Medieval Egypt was the hinge of world trade. Between the Mediterranean and the Red Sea, Egyptian merchants, many of them the Jewish traders whose letters fill the Cairo Geniza, moved Indian spices, Arabian incense, African gold and ivory, and European wool and silver through the warehouses of Fustat and Alexandria, while the Nile's grain fed the cities. Agriculture remained the foundation: the annual flood, measured on the Nilometer at Roda, set the year's taxes, and the irrigation works of valley and Delta were maintained as a sacred trust of government. Society layered itself around faith and function.
The ulama, scholars of law and religion, gave cities their moral leadership; the great merchant houses managed the spice trade; Coptic Christians kept much of the bureaucracy and gradually declined in number; and the military elite, first Fatimid regiments, then Ayyubid and Mamluk slave-soldiers, held political power as a caste apart, freed slaves ruling through their own households and sons unable to inherit. The Mamluk system was a strange meritocracy of slavery: a boy bought on the steppe could rise to be sultan, and some of Egypt's greatest rulers, Baybars, Qalawun, al-Nasir Muhammad, were exactly that. Cairo under the Mamluks became the refuge of Islamic civilization after the Mongol sack of Baghdad: scholars, craftsmen, and poets moved there, a shadow Abbasid caliph lent legitimacy, and builders covered the city with mosques, madrasas, hospitals, fountains, and caravanserais whose carved stone and minarets still define its skyline.
Al-Azhar taught law and theology to students from across the Muslim world; Sufi orders filled the nights with remembrance; and the four Sunni schools of law operated side by side, each with its own chief judge. Coptic culture survived in churches and monasteries, and Jewish communities flourished in relative security. Plague in the fourteenth century, the Black Death and its returns, killed perhaps a third of Egypt's people and crippled its revenues, and when the Portuguese rounded Africa after 1498 and seized the spice routes, the Mamluk economy bled. In 1517 the Ottoman Sultan Selim destroyed the Mamluk army and annexed Egypt, closing six centuries in which Egypt had risen from province to the center of the Islamic world.