<P> Egypt remained semi-autonomous under the Mamluks until it was invaded by the French forces of Napoleon Bonaparte 1798 (see French campaign in Egypt and Syria). After the French were defeated by the British, a power vacuum was created in Egypt, and a three - way power struggle ensued between the Ottoman Turks, Egyptian Mamluks who had ruled Egypt for centuries, and Albanian mercenaries in the service of the Ottomans . </P> <P> After the French were expelled, power was seized in 1805 by Muhammad Ali Pasha, an Albanian military commander of the Ottoman army in Egypt . While he carried the title of viceroy of Egypt, his subordination to the Ottoman porte was merely nominal . Muhammad Ali massacred the Mamluks and established a dynasty that was to rule Egypt until the revolution of 1952 . </P> <P> The introduction in 1820 of long - staple cotton transformed its agriculture into a cash - crop monoculture before the end of the century, concentrating land ownership and shifting production towards international markets . </P> <P> Muhammad Ali 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 . His military ambition required him to modernise the country: he built industries, a system of canals for irrigation and transport, and reformed the civil service . </P>

Where is egypt located in the world map