At the end of the 19th century, Egypt was ruled on three fronts and by three armies: the British army that occupied the land; the Ottoman sultan's government in Istanbul with a nominal ruler, the khedive Tawfik, representing the heirs of Mohamed Ali Pasha; and the Egyptian nobility, some of them remnants of the earlier Mamlukes, who ruled directly over the Egyptian people. Many of the latter suffered from poverty, ignorance and disease and were looking for a saviour to meet their needs. The history of Egypt under the British occupation lasted from 1882 to 1956 when the last British forces withdrew from the country after the Anglo-Egyptian Agreement was signed by former president Gamal Abdel-Nasser in 1954 ending 70 years of the British occupation of Egypt. To understand the circumstances behind the British occupation, it is necessary to go back to the British Alexandria expedition of 1807, called the Fraser Expedition. This was an operation by British forces during the Anglo-Turkish War of 1807-1809, part of the broader Napoleonic Wars, to capture Alexandria and use it as a base for operations against the Ottoman Empire in the Mediterranean. Due to a lack of supplies and inconclusive operations against the Egyptian forces holding the city, the expedition was forced out of Alexandria. Later in the century in 1869, Egypt's then ruler, the khedive Ismail, inaugurated the Suez Canal that had been built as a joint venture between the Egyptian government and the French-led Suez Canal Company. Due to the excessive spending of the government under the overly ambitious khedive, Britain was able to purchase the khedive's shares of the Suez Canal Company in 1875, thus becoming the controlling partner. French and British concerns then led to the establishment of an Anglo-French Condominium over Egypt, at the time still nominally part of the Ottoman Empire. On 26 June 1879, Ismail, at the insistence of Britain and France, was deposed by the Ottoman sultan, who sent orders at the same time that a new ruler, Tawfik, should be proclaimed khedive. Egypt and Sudan at the time were involved in financial and political troubles brought about by the policies of Ismail, and the situation was made worse by the inaction of Britain and France following Tawfik's accession. Tawfik's circle was dissatisfied, the army was disaffected, and his advisers were nearly all adventurers with their own ends in mind. He had neither the character of a strong ruler nor the experience that would have enabled him to secure the orderly administration of affairs. Disorder prevailed until November 1879, when dual control over Egypt was re-established by the governments of Britain and France. For the next two years Egypt was practically governed by these countries. However, disaffection was growing in the Egyptian army, and a secret society was formed with the objective of eliminating the Turkish and Circassian officers who monopolised the highest ranks. This dissatisfaction culminated in the anti-foreign movement headed by Ahmed Orabi Pasha, an Egyptian nationalist who led a social and political movement that expressed the discontent of the Egyptian educated classes, army officials, and others with foreign control of the country. Orabi was promoted to Tawfik's cabinet and began reforms of Egypt's military and civil administrations. On the afternoon of 11 June 1882, the political turmoil exploded into violence on the streets of Alexandria. Rioters attacked Greek, Maltese and Italian businesses and battles broke out in the streets. About 50 Europeans and 250 Egyptians were killed in events later described by Egyptian writer Abbas Mahmoud Al-Akkad as the most violent massacre ever to have taken place on Egyptian soil. It is said that the immediate cause was when a Maltese national related to an officer in the British embassy killed an Egyptian carriage owner when the Egyptian mocked the stinginess of the Maltese after a long day's ride on a very hot day with very little payment. Tawfik was blamed for his failure to take a firm line, and he was unable to control events. The garrison in Alexandria controlled the coastal defence batteries, and an ultimatum was sent by the British demanding that the batteries be dismantled under threat of bombardment. The ultimatum was ignored, and the British fleet off Alexandria under admiral Beauchamp Seymour bombarded the city. The coastal batteries returned fire. A large British naval force then tried to capture the city. Despite encountering heavy resistance, the British forces succeeded, forcing the Egyptians to withdraw. As revolts spread across Egypt, the British House of Commons voted in favour of a larger intervention. In September of the same year, British military forces landed in the Canal Zone. The motivation for the British intervention is still disputed, but probably they were especially concerned that Orabi might default on Egypt's massive debt and try to gain control of the Suez Canal. On 13 September 1882 the British forces defeated Orabi's army at the Battle of Tel Al-Kebir. Orabi was captured and eventually exiled to Ceylon. The historian Ahmed Shafik Pasha, who worked with the later khedive Abbas, wrote in his memoirs about the Orabi revolt that the Ottoman sultan ordered 6,000 soldiers to be sent from Crete to support the British army. The khedive appointed Mohamed Sultan Pasha as his interlocutor with the British, including British general Garnet Wolseley who led the invasion force. The khedive ordered the Egyptian military to cease its resistance to the British forces, saying that these had come to re-establish security in Egypt. Wolseley was given the right to take whatever military measures he might consider necessary. All military ranks should assist and obey his orders, and failure to do so could be considered an act of treason. The khedive Tawfik then returned to Cairo under the protection of the British army. Orabi and his followers were defeated and sent for trial, but were defended by British lawyers Richard Eve and Alexander Meyrick Broadley. “Orabi was another victim of the needs of international diplomacy” at the time, Al-Aqqad later concluded.