Khedivate and British occupation
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 Abdul-Aziz officially sanctioned its use by Isma'il Pasha and his successors. In contrast to his grandfather's policy of war against the Porte, Isma'il sought to strengthen the position of Egypt and Sudan and his dynasty using less confrontational means, and through a mixture of flattery and bribery, Isma'il secured official Ottoman recognition of Egypt and Sudan's virtual independence. This freedom was severely undermined in 1879 when the Sultan colluded with the Great Powers to depose Isma'il in favor of his son Tewfik. 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. While the Khedive would continue to rule over Egypt and Sudan in name, in reality, ultimate power resided with the British High Commissioner.
In defiance of the Egyptians, the British proclaimed Sudan to be an Anglo-Egyptian Condominium, a territory under joint British and Egyptian rule rather than an integral part of Egypt. 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.