The Early Islamic Period (640-969)
Under the first Khalif of Islam Abu Bakr As-Siddiq, Prophet Muhammad's closest companion, the Muslim armies vanquished the Byzantines in 636 AD. They advanced toward Egypt under the command of Amr Ibn Al-'aas, one of the companions of the Prophet.
The Muslims laid siege to Babylon-in-Egypt, which surrendered. They then took ::I and in 642 AD the Byzantine imperial capital of Alexandria. Amr Ibn Al-'as established Fustat north of Babylon-in-Egypt as his military headquarters and seat of government and the Egyptians swiftly embraced the new religion of Islam.
Egypt became part of an expanding empire that was soon to stretch from Spain to Central Asia. The Ummayyad Dynasty ruled Egypt from Damascus until the Abbasids took control of the Caliphate and shifted the political capital of Islam to Baghdad.
Ahmad Ibn Tulun, who had been sent by the Abbasid Caliph Al-Mu'taz to govern Egypt in 868 AD, declared Egypt an independent state and successfully defended his new domain against the Abbasid armies sent to unseat him. His dynasty ruled Egypt for 37 years. Ibn Tulun built Al-Qitai, a new capital centred around a vast central mosque, the courtyard of which could accommodate his entire army and their horses. But Tulunid rule was quickly ended by the Abbasids, who retained direct control over Egypt until Mohammed Ibn Tughj was appointed governor over the province and granted the title Ikhshid, allowing him to rule independently of Caliphate controls. The Ikhshidi Dynasty ruled from 935-969 AD when Egypt was invaded by Shi'aa Fatimid armies from Tunisia.