The Dynasty of Mohammed Ali Pasha (1802-1892)
The French occupation destabilized Egypt; their defeat and withdrawal left the country vulnerable to an internal political struggle which was won by Mohammed Ali, an Albanian lieutenant in the Ottoman army who, with Mamluke help, drove the British (temporarily) out of Egypt. The Ottomans elevate him to khedive or viceroy of Egypt.
In order to consolidate his power, the new khedive realized that he had to eradicate Mamluki power which he did decisively and spectacularly. After six years as ruler, he invited 470 Mamluke soldiers to a banquet at the Citadel. It was a trap; all were massacred and the Mamluke threat was ended.
Although Mohammed Ali was nominally a representative of the Ottoman Sultan he was for all intents and purposes an absolute ruler. He was dedicated to the modern development of Egypt, building factories, railways and canals, bringing in European architects and technicians to create a modern state.
Mohammed Ali was also an ambitious expansionist whose armies extended his power over Syria, Sudan, Greece and the Arabian Peninsula until by 1839 he controlled a large portion of the Ottoman Empire. Throughout his reign, however, Mohammed Ali always kept up the pretence of being a loyal representative of the Caliph.
When it became clear that his power was exceeding acceptable limits, the British intervened, forcing him to relinquish some control to the Ottoman sultan. Mohammed Ali died in 1848 leaving his grandson Abbas to succeed him. Abbas opened Egypt to free trade, closing schools and factories and effectively halting the moves towards industrial development and economic self-sufficiency Mohammed Ali had set in motion.
Said Pasha, the son and successor of Abbas, reversed his father's policies and actively set about developing the country's infrastructure and initiated the building of the Suez Canal which was completed in 1869 by his successor the Khedive Ismail. Under his rule, industrial and civil infrastructure was further developed. More factories were built. A telegraph and postal system was established. Canals and bridges were constructed and the cotton industry which had been introduced during the reign of Mohammed Ali, began to flourish as a result of the American Civil war which prevented southern cotton production for the duration of the war.
However, all this expansion had a price. Ismail's modernization put Egypt heavily into debt and the end of the Civil War and resumption of American cotton production caused a major recession in Egypt's cotton industry. As a result of this economic crisis, Khedive Ismail was forced to abdicate in 1879 and the British began to assume greater control over the country.