[1] After Napoleon’s withdrawal, he aligned himself with Omar Makram, the leader of Egyptian resistance against the French, rose to power with his Albanian troops, and forced the Ottoman Sultan Mahmud II to recognise him as Wāli (Governor) of Egypt in 1805.
Though Muhammad Ali and his descendants used the title of Khedive (Viceroy) in preference to the lesser Wāli, this was not recognized by the Porte until 1867 when Sultan Abdulaziz officially sanctioned its use by Isma'il Pasha and his successors.
Three years later, Egypt and Sudan's freedom became little more than symbolic when the United Kingdom invaded and occupied the country, ostensibly to support Khedive Tewfik against his opponents in Ahmed Orabi's nationalist government.
This was continually rejected by Egyptians, both in government and in the public at large, who insisted on the "unity of the Nile Valley", and would remain an issue of controversy and enmity between Egypt and Britain until Sudan's independence in 1956.
Khedive Abbas II sided with the Ottoman Empire which had joined the Central Powers in the World War I, and was promptly deposed by the British in favor of his uncle Hussein Kamel.
The infant king's reign lasted less than a year, and on 18 June 1953, the revolutionaries abolished the monarchy, and declared Egypt a republic, ending a century and a half of the Muhammad Ali dynasty's rule.