Following the Islamic conquest in 641–642, Lower Egypt was ruled at first by governors acting in the name of the Rashidun Caliphs and then the Umayyad Caliphs in Damascus, but in 750 the Umayyads were overthrown. Throughout Islamic rule, Askar was named the capital and housed the ruling administration. The conquest led to two separate provinces all under one ruler: Upper and Lower Egypt. These two very distinct regions were governed by the military and followed the demands handed down by the governor of Egypt and imposed by the heads of their communities.
Egypt was ruled by many dynasties from the start of Islamic control in 639 until the early 16th century. The Umayyad period lasted from 658 to 750. The Abbasid period which came after was much more focused on taxes and centralizing power. In 868, the Tulunids, ruled by Ahmad ibn Tulun, expanded Egypt's territory into the Levant. He would rule until his death in 884. After years of turmoil under Ahmad ibn Tulun's successor, many citizens defected back to the Abbasids and in 904 they would reclaim power from the Tulunids. In 969, Egypt came under the control of the Fatimids. This dynasty would begin to fade after the death of their last ruler in 1171.
In 1174, Egypt came under the rule of the Ayyubids, who ruled from Damascus and not from Cairo. This dynasty fought against the Crusader States during the Fifth Crusade. Ayyubid Sultan Najm al-Din recaptured Jerusalem in 1244. He introduced Mamluk forces into his army in order to hold off the crusaders. This decision would be one he regretted. The Ayyubids were overthrown by their bodyguards, known as the Mamluks in 1252 and ruled until 1517, when Egypt became part of the Ottoman Empire under the Eyālet-i Mıṣr province.
Early Islamic period
Muslim conquest of Egypt
In 639 an army of some 4,000 men were sent against Egypt by the second caliph, Umar, under the command of Amr ibn al-As. This army was joined by another 5,000 men in 640 and defeated a Byzantine army at the battle of Heliopolis. Amr next proceeded in the direction of Alexandria, which was surrendered to him by a treaty signed on November 8, 641. Alexandria was regained for the Byzantine Empire in 645 but was retaken by Amr in 646. In 654 an invasion fleet sent by Constans II was repulsed. From that time no serious effort was made by the Byzantines to regain possession of the country.
Administration of early Islamic Egypt
Following the first surrender of Alexandria, Amr chose a new site to settle his men, near the location of the Byzantine fortress of Babylon. The new settlement received the name of Fustat, after Amr's tent, which had been pitched there when the Arabs besieged the fortress. Fustat quickly became the focal point of Islamic Egypt, and, with the exception of the brief relocation to Helwan during a plague in 689, and the period of 750–763, when the seat of the governor moved to Askar, the capital and residence of the administration. After the conquest, the country was initially divided in two provinces, Upper Egypt (al-sa'id) and Lower Egypt with the Nile Delta (asfal al-ard). In 643/4, however, Caliph Uthman appointed a single governor (wāli) with jurisdiction over all of Egypt, resident at Fustat. The governor would in turn nominate deputies for Upper and Lower Egypt. Alexandria remained a distinct district, reflecting both its role as the country's shield against Byzantine attacks, and as the major naval base. It was considered a frontier fortress (ribat) under a military governor and was heavily garrisoned, with a quarter of the province's garrison serving there in semi-annual rotation. Next to the wāli, there was also the commander of the police (ṣāḥib al-shurṭa), responsible for internal security and for commanding the jund (army).
The main pillar of the early Muslim rule and control in the country was the military force, or jund, staffed by the Arab settlers. These were initially the men who had followed Amr and participated in the conquest. The followers of Amr were mostly drawn from Yamani (south Arabian) tribes, rather than the northern Arab (Qays) tribes, who were scarcely represented in the province; it was they who dominated the country's affairs for the first two centuries of Muslim rule. Initially, they numbered 15,500, but their numbers grew through emigration in the subsequent decades. By the time of Caliph Mu'awiya I (r. 661–680), the number of men registered in the army list (diwān al-jund) and entitled an annual pay (ʿaṭāʾ) reached 40,000. Jealous of their privileges and status, which entitled them to a share of the local revenue, the members of the jund then virtually closed off the register to new entries. It was only after the losses of the Second Fitna that the registers were updated, and occasionally, governors would add soldiers en masse to the lists as a means to garner political support.
In return for a very small tribute of money (0.5% Jizya tax on some free men) and food for the troops, the Christian inhabitants of Egypt were excused from military service and left free in the observance of their religion and the administration of their affairs.
Conversions of Copts to Islam were initially rare, and the old system of taxation was maintained for the greater part of the first Islamic century. The old division of the country into districts (nomoi) was maintained, and to the inhabitants of these districts demands were directly addressed by the governor of Egypt, while the head of the community—ordinarily a Copt but in some cases a Muslim Egyptian—was responsible for compliance with the demand.
Umayyad period
During the First Fitna, Caliph Ali (r. 656–661) appointed Muhammad ibn Abi Bakr as governor of Egypt, but Amr led an invasion in summer 658 that defeated Ibn Abi Bakr and secured the country for the Umayyads. Amr then served as governor until his death in 664. From 667/8 until 682, the province was governed by another fervent pro-Umayyad partisan, Maslama ibn Mukhallad al-Ansari. During the Second Fitna, Ibn al-Zubayr gained the support of the Kharijites in Egypt and sent a governor of his own, Abd al-Rahman ibn Utba al-Fihri, to the province. The Kharijite-backed Zubayrid regime was very unpopular with the local Arabs, who called upon the Umayyad caliph Marwan I (r. 684–685) for aid. In December 684, Marwan invaded Egypt and reconquered it with relative ease. Marwan installed his son Abd al-Aziz as governor. Relying on his close ties with the jund, Abd al-Aziz ruled the country for 20 years, enjoying wide autonomy and governing as a de facto viceroy. Abd al-Aziz also supervised the completion of the Muslim conquest of North Africa; it was he who appointed Musa ibn Nusayr in his post as governor of Ifriqiya. Abd al-Aziz hoped to be succeeded by his son, but when he died, Caliph Abd al-Malik ibn Marwan (685–695) sent his own son, Abdallah, as governor in a move to reassert control and prevent the country from becoming a hereditary domain.
Abd al-Malik ibn Rifa'a al-Fahmi in 715 and his successor Ayyub ibn Sharhabil in 717 were the first governors chosen from the jund, rather than members of the Umayyad family or court. Both are reported to have increased pressure on the Copts, and initiated measures of Islamization. The resentment of the Copts against taxation led to a revolt in 725. In 727, to strengthen Arab representation, a colony of 3,000 Arabs was set up near Bilbeis. Meanwhile, the employment of the Arabic language had been steadily gaining ground, and in 706 it was made the official language of the government. Egyptian Arabic, the modern Arabic accent and dialect of Egypt, began to form. Other revolts of the Copts are recorded for the years 739 and 750, the last year of Umayyad domination. The outbreaks in all cases are attributed to increased taxation.
Abbasid period
The Abbasid period was marked by new taxations, and the Copts revolted again in the fourth year of Abbasid rule. It became autonomous under Ubaydallah ibn al-Sari during the Fourth Fitna but Abdallah ibn Tahir restored Abbasid rule in 826. At the beginning of the 9th century the practice of ruling Egypt through a governor was resumed under ibn Tahir, who decided to reside at Baghdad, sending a deputy to Egypt to govern for him. In 828 another Egyptian revolt broke out, and in 831 the Copts joined with native Muslims against the government.
A major change came in 834, when Caliph al-Mu'tasim discontinued the practice of paying the jund as they nominally still formed the province's garrison—the ʿaṭāʾ from the local revenue. Al-Mu'tasim discontinued the practice, removing the Arab families from the army registers diwān and ordering that the revenues of Egypt be sent to the central government, which would then pay the ʿaṭāʾ only to the Turkish troops stationed in the province. This was a move towards centralizing power in the hands of the central caliphal administration, but also signalled the decline of the old elites, and the passing of power to the officials sent to the province by the Abbasid court, most notably the Turkish soldiers favoured by al-Mu'tasim. At about the same time, for the first time the Muslim population began surpassing the Coptic Christians in numbers, and throughout the 9th century the rural districts were increasingly subject to both Arabization and Islamization. The rapidity of this process, and the influx of settlers after the discovery of gold and emerald mines at Aswan, meant that Upper Egypt in particular was only superficially controlled by the local governor. Furthermore, the persistence of internecine strife and turmoil at the heart of the Abbasid state—the so-called "Anarchy at Samarra"—led to the appearance of millennialist revolutionary movements in the province under a series of Alid pretenders in the 870s. In part, these movements were an expression of dissatisfaction with and alienation from imperial rule by Baghdad; these sentiments would manifest themselves in the support of many Egyptians for the Fatimids in the 10th century.
Tulunid period
In 868, Caliph al-Mu'tazz (r. 866–869) gave charge of Egypt to the Turkish general Bakbak. Bakbak in turn sent his stepson Ahmad ibn Tulun as his lieutenant and resident governor. This appointment ushered in a new era in Egypt's history: hitherto a passive province of an empire, under Ibn Tulun it would re-emerge as an independent political centre. Ibn Tulun would use the country's wealth to extend his rule into the Levant, in a pattern followed by later Egypt-based regimes, from the Ikhshidids to the Mamluk Sultanate.
The first years of Ibn Tulun's governorship were dominated by his power struggle with the powerful head of the fiscal administration, the Ibn al-Mudabbir. The latter had been appointed as fiscal agent (ʿāmil) already since c. 861, and had rapidly become the most hated man in the country as he doubled the taxes and imposed new ones on Muslims and non-Muslims alike. By 872 Ibn Tulun had achieved Ibn al-Mudabirbir's dismissal and taken over the management of the fisc himself, and had managed to assemble an army of his own, thereby becoming de facto independent of Baghdad. As a sign of his power, he established a new palace city to the northeast of Fustat, called al-Qata'i, in 870. The project was a conscious emulation of, and rival to, the Abbasid capital Samarra, with quarters assigned to the regiments of his army, a hippodrome, hospital, and palaces. The new city's centerpiece was the Mosque of Ibn Tulun. Ibn Tulun continued to emulate the familiar Samarra model in the establishment of his administration as well, creating new departments and entrusting them to Samarra-trained officials. His regime was in many ways typical of the "ghulām system" that became one of the two main paradigms of Islamic polities in the 9th and 10th centuries, as the Abbasid Caliphate fragmented and new dynasties emerged. These regimes were based on the power of a regular army composed of slave soldiers or ghilmān, but in turn, according to Hugh N. Kennedy, "the paying of the troops was the major preoccupation of government". It is therefore in the context of the increased financial requirements that in 879, the supervision of the finances passed to Abu Bakr Ahmad ibn Ibrahim al-Madhara'i, the founder of the al-Madhara'i bureaucratic dynasty that dominated the fiscal apparatus of Egypt for the next 70 years. The peace and security provided by the Tulunid regime, the establishment of an efficient administration, and repairs and expansions to the irrigation system, coupled with a consistently high level of Nile floods, resulted in a major increase in revenue. By the end of his reign, Ibn Tulun had accumulated a reserve of ten million dinars.