Fustat was founded in 751 near other Egyptian cities and villages, including the old Egyptian capital Memphis, Heliopolis, Giza and the Byzantine fortress of Babylon-in-Egypt. Fustat was itself a new city built as a military garrison for Arab troops and was the closest central location to Arabia that was accessible to the Nile. Fustat became a regional center of Islam during the Umayyad period and was where the Umayyad ruler, Marwan II, made his last stand against the Abbasids. Later, during the Fatimid era, Al-Qahira (Cairo) was officially founded in 969 as an imperial capital just to the north of Fustat. Over the centuries, Cairo grew to absorb other local cities such as Fustat, but the year 969 is considered the "founding year" of the modern city.
In 1250, the slave soldiers or Mamluks seized Egypt and ruled from their capital at Cairo until 1517, when they were defeated by the Ottomans. Napoleon's French army briefly occupied Egypt from 1798 to 1801, after which an Ottoman officer named Muhammad Ali made Cairo the capital of an independent empire that lasted from 1805 to 1882. The city then came under British control until Egypt attained independence in 1922.
Today, Greater Cairo encompasses various historic towns and modern districts into one of the most populous cities in the world. A journey through Cairo is a virtual time travel: from the Pyramids, Saladin's Citadel, the Virgin Mary's Tree, the Sphinx, and ancient Heliopolis, to Al-Azhar, the Mosque of Amr ibn al-A'as, Saqqara, the Hanging Church, and the Cairo Tower. It is the Capital of Egypt, and indeed its history is intertwined with that of the country. Today, Cairo's official name is Al-Qahira (Cairo), although the name informally used by most Egyptians is "Masr" (Egyptian Arabic name for Egypt), from the original name of Egypt's first Arab capital Fustat, Misr al-Fustat, "City of the Tents."