The first settlement in the region of present-day Cairo was al-Fustat, founded in A. D. 641 as a military encampment by the Arabic commander 'Amr ibn al-'As. Under the dynasties that ruled Egypt over the following centuries, the town grew into a major port city. In A. D. 969 Jawhar, the leader of an Islamic sect called the Fatimids, founded a new city near al-Fustat, initially naming it al-Mansuriyah (its name was later changed to al-Qahirah, or Cairo). When the Fatimids became the rulers of Egypt, founding a dynasty that lasted for two centuries, Cairo became their capital.

When Saladin, a Sunni Muslim, defeated the Crusaders and founded the Ayyubid dynasty in the twelfth century, he retained Cairo as his capital, and it became the center of a vast empire. (Al-Fustat, however, was burned down as part of the "scorched earth" strategy that defeated the Crusaders.) In the thirteenth century, the Ayyubids were eclipsed by Turkish military conquerors known as the Mamluks, who ruled Egypt from A. D. 1260 to 1516. During the first hundred years of Mamluk rule, Cairo experienced its most illustrious period. Al-Azhar University, which had been founded in the tenth century, became the foremost center of learning in the Islamic world, and Cairo played a key role in the east-west spice trade. Most of its greatest buildings were constructed during this period.

City Fact Comparison
Indicator Cairo New York Rome Beijing
(Egypt) (United States) (Italy) (China)
Population of urban area1 10,772,000 16,626,000 2,688,000 12,033,000
Date the city was founded AD 969 1613 753 BC 723 BC
Daily costs to visit the city2
Hotel (single occupancy) $193 $198 $172 $129
Meals (breakfast, lunch, dinner) $56 $44 $59 $62
Incidentals (laundry, dry cleaning, etc.) $14 $26 $15 $16
Total daily costs (hotel, meals, incidentals) $173 $244 $246 $207
Major Newspapers3
Number of newspapers serving the city 13 10 20 11
Largest newspaper Akhbar El Yom/Al Akhbar The Wall Street Journal La Repubblica Renmin Ribao
Circulation of largest newspaper 1,159,339 1,740,450 754,930 3,000,000
Date largest newspaper was established 1944 1889 1976 1948
1United Nations population estimates for the year 2000.
2The maximum amount the U.S. Government reimburses its employees for business travel. The lodging portion of the allowance is based on the cost for a single room at a moderately-priced hotel. The meal portion is based on the costs of an average breakfast, lunch, and dinner including taxes, service charges, and customary tips. Incidental travel expenses include such things as laundry and dry cleaning.
3David Maddux, ed. Editor&Publisher International Year Book. New York: The Editor&Publisher Company, 1999.

Starting in the second half of the fourteenth century, Cairo experienced a decline, beginning with the scourge of the Black Death (1348) and other epidemics.

Cairo skyline along the Nile River. ()
By the end of the fifteenth century, new trade routes had broken the city's monopoly on the spice trade, and in 1517 the Ottoman sultan Selim I (r. 1512–20) conquered Egypt, defeating the Mamluk forces at Ar Raydaniyah, outside Cairo, and the city came under Turkish rule. Under the Ottomans, Cairo was reduced to a provincial capital, and by the end of the eighteenth century, its population had declined to under 300,000. The city was occupied by Napoleon's troops between 1798 and 1801 but then returned to Turkish rule.

The modernization of Egypt and its capital began under Mehemet 'Ali (c. 1769–1849), often called the "father of modern Egypt," who ruled the country for nearly half a century beginning in 1805, modernizing and strengthening it, and expanding its borders. Modernization of Cairo began in 1830, but the period of greatest progress occurred during the reign of Ismail Pasha (r. 1863-79). Pasha undertook a major modernization of the city modeled on the renovation of Paris under Napoleon III (1808–1873). To the west of the older, medieval part of Cairo (now called Islamic Cairo), a newer section of the city boasted wide avenues laid out around circular plazas in the style of a European city. The development of this area was also influenced by the growth of French and British colonial power in Egypt.

The advent of the twentieth century saw advances in bridge building and flood control, which encouraged riverfront development. By 1927, Cairo's population had reached one million. In the first half of the century, Cairo was dominated by foreign influences. During World War I (1914–18), it became the center for British military operations in the region, and British troops were headquartered in the city. The British military presence in Egypt was curtailed in the 1920s, but the country was reoccupied by British forces during World War II (1939–1945).

With the Egyptian Revolution in 1952, the colonial presence in Cairo—and throughout the country—came to an end. Since then, large numbers of Egyptians from other parts of the country have migrated to the capital, and the government has worked to accommodate a rapidly growing urban population by creating new, planned suburbs, including Nasr City, Muqattam City, and Engineers' City.

In recent decades, Cairo has become the nation's industrial, commercial, and cultural center, as well as the seat of its government.