Muhammad Ali was a pasha of Albanian origin who was appointed by the Ottoman sultan in 1805 to restore order after the French occupation of Egypt (1798-1801). However, he subsequently established himself as "de facto" independent ruler of the country. He consolidated power through a famous and violent coup in 1811 which eliminated the remaining Mamluk class that still formed the country's elites. One of the most pivotal events of this coup took place in the Citadel. Muhammad Ali invited the Mamluk leaders to a celebration banquet in the Citadel, and as they were leaving and passing along the road leading from the upper Citadel to Bab al-Azab, regiments of his Albanian gunmen opened fire from above and massacred all of them.