Although Muhammad Ali had only been granted the title of wali, he proclaimed himself khedive, or hereditary viceroy, early on during his rule. The Ottoman government, although irritated, did nothing until Muhammad Ali invaded Ottoman-ruled Syria in 1831. The governorship of Syria had been promised him by the sultan, Mahmud II, for his assistance during the Greek War of Independence, but the title was not granted to him after the war. This caused the Ottomans, allied with the British, to counter-attack in 1839.
Sa'id ruled for only nine years, and his nephew Isma'il, another grandson of Muhammad Ali, became wali. In 1866 the polity occupied the Emirate of Harar. In 1867, the Ottoman sultan acknowledged Isma'il's use of the title khedive. In 1874, Ismail Pasha ordered the deputation of warships to patrol Tadjoura whereafter for ten years, the Khedivate was established from Zaylac to Berbera, until their withdrawal in April 1884 and failed attempts to establish themselves beyond Berbera and the eastern littoral of Somalia.
British occupation ended nominally with the deposition of the last khedive Abbas II on 5 November 1914 and the establishment of a British protectorate, with the installation of sultan Hussein Kamel on 19 December 1914.
Seriously concerned with the country's financial situation, Ismail asked for British help in fiscal reform. Britain responded by sending Steven Cave, a member of Parliament, to investigate. Cave judged Egypt to be solvent on the basis of its resources and said that all the country needed to get back on its feet was time and the proper servicing of the debts. Cave recommended the establishment of a control commission over Egypt's finances to approve all future loans. European creditors, however, would not allow Egypt time. When Ismail suspended payment of interest on the loans in 1875, his creditors in Britain and France appointed two men to represent their interests and negotiate new arrangements with the khedive. The Goschen-Joubert Mission achieved three things: the consolidation of the debt; the appointment of two European controllers, one British and one French; and the establishment of the Caisse de la Dette Publique, a special department with representatives from the various European creditor states to ensure the service of the debt. Revenue from the most productive provinces went straight to the department, and by 1877 more than 60 percent of all Egyptian revenue went to service the national debt. Although Egypt serviced the debt faithfully, European intervention increased. At the insistence of the French, a commission of inquiry was appointed in 1878 to examine all sources of revenue and expenditure. The commission had the right to ask any Egyptian official or government deputy to testify before it and to subpoena all records. Such powers implied the dilution of Egyptian sovereignty by Europeans. The commission report indicted the khedival government and suggested limiting Ismail's power as a first step in solving the country's financial problems. The khedive accepted the commission's conditions, including a cabinet containing Europeans and the principle of ministerial responsibility. He appointed Nubar Pasha as prime minister and asked him to form a government containing two Europeans. Many Europeans were appointed at high salaries in various government departments; thirty British officers were appointed to the Land Survey Department alone. Ismail was also forced to delegate governmental responsibility to his cabinet, which was made independent of the khedive and responsible for the administration of the country. Opposition to European intervention in Egypt's internal affairs emerged from the Assembly of Delegates, which Ismail had created in 1866, and from the Egyptian army officers. The assembly, composed mainly of Egyptian notables, had no legislative power. It was Ismail's attempt to associate the Egyptian notables with his financial policies, and thus, to demonstrate support for his taxes and foreign loans. The presence of Egyptian officers in the army resulted from the 1854 decree of Said, who ordered the sons of village notables to join the army. Said allowed them to be trained as officers and to rise to the rank of colonel, but the top posts in the army continued to be held by members of the Turco-Circassian elite. The Assembly of Delegates, meeting between January and July 1879, demanded more control over financial matters and accountability of the European ministers to the assembly. At the same time, a group of Egyptian army officers who opposed the mixed cabinet protested the placing of 2,500 officers on half- pay. A group of army officers marched on the Ministry of Finance and occupied the building. Only the personal intervention of the khedive, who was suspected of instigating the incident, saved the situation. At this point, Ismail realized that he could use both the assembly and the army officers to rid himself of foreign control. In April 1879, Ismail's opportunity came. Under foreign pressure, Ismail ordered the assembly to dissolve. Its members refused, saying they represented the nation and would not relinquish their mandate at the order of the khedive, influenced and pressured as he was by foreign powers. On March 29, they presented a manifesto to the khedive protesting the Council of Ministers' attempts to usurp their power and authority. They also stated their determination to reject the European ministers' demand that Egypt declare itself bankrupt. The leader of the delegates was the constitutionally minded Muhammad Sharif Pasha, who was among the members of a secret society called the National Society (later the Hulwan Society). The society had drawn up a plan for national reform (Laiha Wataniyah) that proposed constitutional and financial reforms to increase the power of the assembly and resolve Egypt's financial problems without foreign advisers or control. In a shrewd political move, Ismail summoned the European consuls and confronted them with the discontent of the delegates, the disaffection in the army, and the general public uneasiness. He informed them that he had decided to act in accordance with the resolutions of the assembly. Therefore, he rejected the proposal to declare Egypt bankrupt and stated his intent to meet all obligations to Egypt's creditors. He also invited Sharif Pasha to form a government. Sharif Pasha and his Egyptian cabinet dismissed the European ministers. Although these actions made Ismail popular at home, they threatened continued European control over Egypt's finances. The European powers, particularly Britain and France, decided Ismail had to go. Since he refused to abdicate, the European powers put pressure on the Ottoman sultan to dismiss him in favor of his son Tawfiq. On June 26, 1879, he received a telegram from the grand vizier addressed to "the ex-khedive Ismail." Ismail left Egypt for exile in Naples and subsequently in Istanbul, where he died in 1895. Tawfiq proved to be a more pliable instrument in the hands of the European powers. The dual control of Egypt's finances was reinstituted. An international commission of liquidation was appointed with British, French, Austrian, and Italian members. In July 1880, the Law of Liquidation was promulgated, limiting Egypt to 50 percent of its total revenues. The rest went to the Caisse de la Dette Publique to service the debt. The Assembly of Delegates remained dissolved. The direct interference of Europeans in Egypt's affairs and the deposition of Khedive Ismail forged a nationalist movement composed of Egyptian landowners and merchants, especially former members of the assembly, Egyptian army officers, and the intelligentsia, including the ulama and Muslim reformers. A secret society of Egyptian army officers had also come into existence in 1876, comparable to the secret society of Egyptian notables. The army society included Colonel Ahmad Urabi, who would become the leader of the nationalist movement, and colonels Ali Fahmi and Abd al Al Hilmi. In 1881 a link, if not a merger, was formed between the Urabists and the National Society. This expanded group took the name Al Hizb al Watani al Ahli, the National Popular Party. Beginning in 1881, the army officers demonstrated their strength and their ability to intimidate the khedive. They began with a mutiny provoked by the anti-Urabist minister of war. Not only were they able to force the appointment of a more sympathetic minister but by January 1882, Urabi joined the government as undersecretary for war. These developments alarmed the European powers, particularly Britain and France. Britain was especially concerned about protecting the Suez Canal and the British lifeline to India. In January 1882, Britain and France sent a joint note declaring their support for the khedive. The note had the opposite effect from that intended, producing an upsurge in anti-European feeling, a shift in leadership of the nationalist movement from the moderates in the assembly to the military, and the formation of a new government with Urabi as minister of war. At this point, the goal of Urabi and his followers became not only the removal of all European influence from Egypt but also the overthrow of the khedive. In another attempt to break Urabi's power, the British and French agreed on a joint show of naval strength. They also issued a series of demands including the resignation of the government, the temporary exile of Urabi, and the internal exile of his two closest associates, Ali Fahmi and Abd al Al Hilmi. As a result, violent anti-European riots broke out in Alexandria with considerable loss of life on both sides. During the summer, an international conference of the European powers met in Istanbul, but no agreement was reached. The Ottoman sultan Abdul Hamid boycotted the conference and refused to send troops to Egypt. Eventually, Britain decided to act alone. The French withdrew their naval squadron from Alexandria, and in July 1882, the British fleet began bombarding Alexandria. Following the burning of Alexandria and its occupation by British marines, the British installed the khedive in the Ras at Tin Palace. The khedive obligingly declared Urabi a rebel and deprived him of his political rights. Urabi in turn obtained a religious ruling, a fatwa, signed by three Al Azhar shaykhs, deposing Tawfiq as a traitor who brought about the foreign occupation of his country and betrayed his religion. Urabi also ordered general conscription and declared war on Britain. Thus, as the British army was about to land in August, Egypt had two leaders: the khedive, whose authority was confined to British-controlled Alexandria, and Urabi, who was in full control of Cairo and the provinces. In August Sir Garnet Wolsley and an army of 20,000 invaded the Suez Canal Zone. Wolsley was authorized to crush the Urabi forces and clear the country of rebels. The decisive battle was fought at Tall al Kabir on September 13, 1882. The Urabi forces were routed and the capital captured. The nominal authority of the khedive was restored, and the British occupation of Egypt, which was to last for seventy-two years, had begun. Urabi was captured, and he and his associates were put on trial. An Egyptian court sentenced Urabi to death, but through British intervention the sentence was commuted to banishment to Ceylon. Britain's military intervention in 1882 and its extended, if attenuated, occupation of the country left a legacy of bitterness among the Egyptians that would not be expunged until 1956 when British troops were finally removed from the country.