The Copts’ aversion to the Eastern Roman religious policy paved the way for the Muslim Arabs under Amr Ibn al-As 640/642 into the Nile Valley, whose capital now became Fustat. Since then, the Copts have enjoyed extensive religious freedom. In addition, economic policy, administration and currency of the Byzantines (gold denar) were retained; it was not until the 8th century that Greek was gradually replaced by Arabic (as evidenced by the papyri). Coptic uprisings (between 725/726 and 829/830) were triggered by the realization that Islamic rule did not bring them any real freedom either. But they were unsuccessful. Sunni Islam is believed to have won the majority of the population around 900. The administration of the Abbasids, exercised by princes of the house or Turkish generals as governors, was replaced by the Tulunids in 868–905, and by the Ichschidids in 935–969; among them, according to mathgeneral, Egypt was de facto independent from the caliphate.
The separation from the Caliphate became final in 969 through the conquest by the Fatimids, who soon afterwards founded Cairo and the Azhar Mosque. Under the Fatimids, the country initially experienced a significant economic and cultural boom, especially under the conqueror al-Muiss (953 / 969–975) and his son al-Asis (until 996). Among them, the Copts, Armenians and Jews enjoyed greater tolerance as a counterweight to the bulk of the Sunni population. When Hakim (996-1021) allowed himself to be venerated as a divine incarnation in exaggeration of Ismaili teachings (Druze) and through an eventful religious policy (several Copts persecutions) disrupted the internal equilibrium, the importance of the dynasty declined. So it could be ousted by the Seljuks from Syria and Palestine. The activity of their Ismaili recruits in Persia and the Mesopotamia was stopped. Finally, in 1171, Saladin expelled the Fatimids, closed the Azhar mosque and eliminated the Ismailis in the country. He found his main support in Egypt in the fight against the crusaders, who later did not break in here. Since his descendants (Aijubids) split up their rule by forming small states, the Bahritic Mamluks sat down in 1250 and the Burdjitic Mamluks in 1382/90(Mamelukes), generals mostly of Turkish or Caucasian descent. They were able to intercept the advance of the Mongols at the Goliath Spring in Palestine in 1260 and thereby protected the country from intruders from the east. Prepared by the upswing under the Aijubids, Egypt (with the Maghreb) became the center of Arab-Islamic theology and spiritual culture after the elimination of Baghdad in 1258. This still has an effect today, thanks in part to the influence of the Azhar Mosque, which reopened in 1250 (now as a Sunni madrasah). At that time Egypt also gained increasing economic importance through the mediation of trade between the Mediterranean, the Red Sea and India. The Mamluk sultans largely had state (as a monopoly) organized trade in their own hands. Also the Islamic art took place in the 14th and 15th centuries. Century a significant boom (Mamluk graves). After the elimination of the last Crusader states (1291) and Lesser Armenia (1375), Egypt was able to maintain rule over Syria for a long time.
Gradually, the Ottomans made Egypt a dangerous enemy in its north. After decades of conflict under Selim I, they succeeded in conquering Syria and Egypt in 1516/17. As a Turkish province, however, Egypt was largely left to the administration of native Mamluks, who continued to exploit the townspeople and the fellahs. The Turkish governors (pashas) were also from the approval of the 24 Mamlukenbeis ( Bei) addicted. Moreover, the country was badly damaged by the discovery of the sea route to the East Indies with the cessation of the intermediate trade; its prosperity deteriorated rapidly. From 1763 the Mamluks rose again against the Ottomans; since 1773 Egypt was almost independent under the rule of two Beis. In 1795, the French consul in Cairo called the aid of his homeland against their violent measures, triggering Napoleon’s Egyptian expedition. After the French and British had withdrawn, an officer of Albanian descent, Mehmed Ali, succeeded in asserting himself and restoring order from 1805 onwards. He murdered the Mamluks in 1811, and put his power on the Wahhabis opposite by, conquered Nubia, Fung and Kordofan in the south in 1820/22; on the Turkish side, he intervened in the Greek war of liberation. In contrast, attempts to break away from Ottoman suzerainty in 1832 and 1839/40 failed due to the intervention of the major European powers. He had to give up Syria, Cyprus and Crete again, but was recognized as the hereditary governor of the Nile Valley in 1841. Inside, Mehmed Ali promotedthe establishment of a modest industry, the expansion of agriculture (especially cotton), gave up the state trade monopoly under Ottoman pressure and created a fellach army with the help of French advisers. Through this he became the founder of the modern Egyptian state, in which European ideas and knowledge spread more and more. His son Said Pascha (1854–63) took care of further reforms (after the brief reign of Abbas I. Hilmi), who distributed the tax burden more equitably, abolished slavery, had railways built and initiated the construction of the Suez Canal (1859). His nephew Ismail Pascha (1863–79) promoted the construction of factories and transport facilities as well as the construction of the post office.