The history of Cairo begins, in essence, with the conquest of Egypt by Muslim Arabs in 640, under the commander 'Amr ibn al-'As. Although Alexandria was the capital of Egypt at that time (and had been throughout the Ptolemaic, Roman, and Byzantine periods), the Arab conquerors decided to establish a new city called Fustat to serve as the administrative capital and military garrison center of Egypt. The new city was located near a Roman-Byzantine fortress known as Babylon on the shores of the Nile (now located in Old Cairo), southwest of the later site of Cairo proper (see below). The choice of this location may have been due to several factors, including its slightly closer proximity to Arabia and Mecca, the fear of strong remaining Christian and Hellenistic influence in Alexandria, and Alexandria's vulnerability to Byzantine counteroffensives arriving by sea (which did indeed occur). Perhaps even more importantly, the location of Fustat at the intersection of Lower Egypt (the Nile Delta) and Upper Egypt (the Nile Valley further south) made it a strategic place from which to control a country that was centered on the Nile river, much as the Ancient Egyptian city of Memphis (located just south of Cairo today) had done. (The pattern of founding new garrison cities inland was also one that was repeated throughout the Arab conquests, with other examples such as Qayrawan in Tunisia or Kufa in Iraq.) The foundation of Fustat was also accompanied by the foundation of Egypt's (and Africa's) first mosque, the Mosque of 'Amr ibn al-'As, which has been much rebuilt over the centuries but still exists today.