Ottoman Egypt. In 1517 the Ottoman Sultan Selim I destroyed the Mamluk army outside Cairo, executed the last sultan, and annexed Egypt to the Ottoman Empire, ending Egypt's independence for nearly three centuries. Under Ottoman rule Egypt remained wealthy but was governed from Istanbul: an appointed pasha held office briefly, taxes flowed to the imperial treasury, and the old Mamluk military households survived and recovered power until by the eighteenth century the beys ruled in fact behind the Ottoman facade, competing among themselves in factions while plague and exaction ground down the countryside. The sleeping province awoke violently in 1798 when Napoleon Bonaparte landed a French army at Alexandria, shattered the Mamluk cavalry at the Battle of the Pyramids, and occupied Egypt for three years.
The invasion failed strategically, the British destroyed the French fleet at the Nile, and Ottoman and British pressure forced withdrawal, but it shattered the old order, revealed European power, and brought the scholars of Napoleon's expedition, whose Description of Egypt opened the ancient civilization to modern study. Out of the wreckage rose Muhammad Ali, an Albanian officer of the Ottoman forces, who by 1805 had made himself governor, and in 1811 destroyed the Mamluks in a single massacre at the Citadel. Muhammad Ali ruled until 1848 and remade Egypt as a modern state: he built a conscript army of Egyptian peasants trained by French officers, founded schools and sent students to Europe, dug the Mahmudiyya canal to Alexandria, expanded cotton into a cash crop that enriched the treasury, and established factories, a printing press, and a modern bureaucracy.
His armies campaigned in Arabia, Sudan, and Greece, and his son Ibrahim Pasha nearly toppled the Ottoman sultan himself before the European powers forced him back. Muhammad Ali's dynasty ruled Egypt until 1952, but his successors squandered his strength: Said Pasha granted the Suez Canal concession, and Khedive Ismail, who built modern Cairo with its boulevards and opera house and declared Egypt no longer part of Africa but of Europe, borrowed so recklessly that in 1876 Egypt's finances were placed under European control. Resentment produced the Urabi revolt of army officers and notables, and in 1882 Britain bombarded Alexandria, defeated Urabi at Tel el-Kebir, and occupied Egypt, which would remain under British control, nominally Ottoman then a protectorate then formally independent, for seventy years. The Ottoman centuries had their own rhythm.
For the first two hundred years Egypt was the empire's granary and its second source of revenue, governed by a pasha changed every year or two, guarded by janissary garrisons, and managed in practice by the Mamluk beys, who reconstituted their households within a generation of the conquest and ruled the tax farms of the countryside. The eighteenth century saw the beys become princes in all but name: Ali Bey al-Kabir even expelled the Ottoman governor, conquered the Hijaz and Syria briefly, and dreamed of restoring Egypt's independence before his defeat and death in 1773, while plague, exaction, and the chaos of Mamluk faction reduced the country to perhaps half its medieval population.
Napoleon's occupation lasted only three years but detonated the old world: the Mamluk cavalry broke against French squares at the Pyramids, the scholars of the expedition measured and drew every monument from Alexandria to Aswan, and Egyptians watched a handful of Europeans defeat the celebrated Mamluk cavalry and then be expelled by the British and the Ottomans together, a lesson in power no one forgot. Muhammad Ali learned it best: his model was France, his method the modern centralized state, and his ambition hereditary rule. He massacred the Mamluks in 1811, built factories for uniforms, guns, and ships, created a national conscript army on the European model, and made Egyptian cotton a world crop.
His grandson Abbas closed things down, Said opened them to concession, and Ismail built a European Cairo and an African empire in Sudan while borrowing at ruinous rates until the creditors took the treasury in 1876 and the army revolted under Urabi in 1881. The British occupation that followed in 1882 was meant to be temporary and lasted seventy years, a precolonial century ending in a colonial one, whose struggles belong to Egypt's modern story.
Ottoman and nineteenth-century Egypt was a society of villages and a great city. Most Egyptians were fellahin, peasants bound to the rhythms of the Nile flood, paying taxes to whoever ruled, their lives centered on the village, the mosque, and the saints' festivals; Cairo, among the largest cities of the world, remained the hub of commerce and scholarship, its markets and its ancient university of al-Azhar drawing students from across Islam, while a cosmopolitan merchant class of Turks, Greeks, Armenians, Jews, and Italians mediated Egypt's trade with Europe. The Ottoman centuries had drained Egypt's wealth abroad, but Muhammad Ali's modernization created something new: a state that taxed, conscripted, educated, and industrialized on the European model, and an Egyptian identity stirred by contact with both Europe and the Arab past.
The nineteenth century brought an intellectual awakening, the nahda: the sheikh Rifa'a al-Tahtawi returned from Paris to translate European works and argue that Islam was compatible with modern science and law; the printing press spread newspapers and books; and Egyptians rediscovered both their Islamic heritage and, through the decipherment of hieroglyphs by Champollion, their pharaonic past, which Europeans studied in the monuments Egyptians had long ignored. But modernization rested on cotton, debt, and coercion: peasants were conscripted for army and canal, the Suez Canal opened in 1869 with Egypt paying ruinously for a waterway owned by foreign shareholders, and Ismail's debts surrendered Egypt's finances to its European creditors. Social protest grew from the 1870s: army officers resented the Turco-Circassian elite, peasants suffered tax and corvee, and a national movement formed behind Colonel Ahmad Urabi with the cry Egypt for the Egyptians.
The British occupation of 1882 answered that cry with empire, ruling through a veiled protectorate behind the khedive, developing cotton and railways for export, and provoking the nationalism that would dominate the next century. Medieval Egypt had been the heart of Islam; Ottoman and khedival Egypt became the testing ground where a proud society confronted European modernity, adopted much of it, and resolved to master its own fate again.