Mehemet Ali, an Albanian born in Kavala, made himself the ruler of Egypt and treacherously massacred the Mameluke leaders. He introduced sweeping reforms to Egypt. He built an army from Egyptian peasants through conscription, and used this force to greatly expand Egypt's borders. He built much infrastructure such as canals and roadways and established Egypt as one of the world's largest cotton producers. Ali also greatly reformed Egyptian society creating some of the first modern educational institutions. Almost all of his reforms were directed at strengthening Egypt's armed forces, in which he was very successful.
While throughout his reign he was the nominal vassal of the Ottoman Sultan, he acted independently. While he aided the Sultan in fighting in the Greek War of Indepedence and put down a Wahhabi revolt in Arabia for him, later the two fell out. Under his son Ibraihim Pasha Ali's armies seized Palestine and Syria and were within a few days march of Constantinople. European intervention led to a negotitated solution, however. Ali soon fell out with his son and much of the gains were lost.
Ali was succeeded by two of his sons, but both were weak rulers, and, in large part because of Ali's excesses, the country fell under the domination of Europeans.