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.