The area around present-day Cairo, especially Memphis, had long been a focal point of Ancient Egypt due to its strategic location just upstream from the Nile Delta. However, the origins of the modern city are generally traced back to a series of settlements in the first millennium. Around the turn of the 4th century, as Memphis was continuing to decline in importance, the Romans established a fortress town along the east bank of the Nile. This fortress, known as Babylon, remains the oldest structure in the city. It is also situated at the nucleus of Egypt's Coptic Christian community, which separated from the Roman and Byzantine church in the late 4th century. Many of Cairo's oldest Coptic churches, including The Hanging Church, are located along the fortress walls in a section of the city known as Coptic Cairo.
After the Muslim conquest of Egypt in 641, Rashidun commander 'Amr ibn al-'As established Fustat just north of Cairo and Babylon. At Caliph Umar's request, the Egyptian capital was moved from Alexandria to the new city. Fustat also became a regional centre of Islam and home to the Mosque of Amr ibn al-As, the first mosque in Egypt. When the Abbasids usurped the Umayyads in 750, they moved the capital to al-Askar, which they had built just north of Fustat. In 868, under the Tulunids, Egypt's capital was moved further north to their own settlement, al-Qatta'i. However, neither al-Askar nor al-Qatta'i achieved the prominence of Fustat; al-Askar had become indistinguishable from Fustat by the end of the 9th century, and al-Qatta'i was destroyed by the Abbasids when they recaptured Egypt in 905. With the Abbasids' second conquest, Fustat once again became the capital of Egypt. According to Encyclopædia Americana, the city was founded by the second caliph, Omar ibn al-Khatt?b.