of the country's population.
After the 15th century, the Ottoman invasion pushed the Egyptian system into decline. The defensive militarization damaged its civil society and economic institutions. The weakening of the economic system combined with the effects of plague left Egypt vulnerable to foreign invasion. Portuguese traders took over their trade. Egypt suffered six famines between 1687 and 1731. The 1784 famine cost it roughly one-sixth of its population.
Further information: French Campaign in Egypt and Syria, Ottoman–Saudi War, Muhammad Ali's seizure of power, First Turko-Egyptian War, Second Turko-Egyptian War, and Khedivate of Egypt
The brief French invasion of Egypt led by Napoleon Bonaparte began in 1798. The expulsion of the French in 1801 by Ottoman, Mamluk, and British forces was followed by four years of anarchy in which Ottomans, Mamluks, and Albanians — who were nominally in the service of the Ottomans — wrestled for power. Out of this chaos, the commander of the Albanian regiment, Muhammad Ali (Kavalali Mehmed Ali Pasha) emerged as a dominant figure and in 1805 was acknowledged by the Sultan in Istanbul as his viceroy in Egypt; the title implied subordination to the Sultan but this was in fact a polite fiction: Ottoman power in Egypt was finished and Muhammad Ali, an ambitious and able leader, established a dynasty that was to rule Egypt until the revolution of 1952. In later years, the dynasty became a British puppet.
His primary focus was military: he annexed Northern Sudan (1820–1824), Syria (1833), and parts of Arabia and Anatolia; but in 1841 the European powers, fearful lest he topple the Ottoman Empire itself, forced him to return most of his conquests to the Ottomans, but he kept the Sudan and his title to Egypt was made hereditary. A more lasting result of his military ambition is that it required him to modernize the country. Eager to adopt the military (and therefore industrial)