Following the completion of the Suez Canal by Ismail Pasha in 1869, Egypt became an important world transportation hub. In 1866, the Assembly of Delegates was founded to serve as an advisory body for the government. Its members were elected from across Egypt and eventually they came to have an important influence on governmental affairs. The country also fell heavily into debt to European powers. Ostensibly to protect its investments, the United Kingdom seized control of Egypt's government in 1882. Nominal allegiance to the Ottoman Empire continued, however, until 1914. As a result of the declaration of war with the Ottoman Empire, Britain declared a protectorate over Egypt and deposed the Khedive Abbas II, replacing him with his uncle, Husayn Kamil, who was appointed Sultan.
Between 1882 and 1906, a local nationalist movement for independence was taking shape. The Dinshaway Incident prompted Egyptian opposition to take a stronger stand against British occupation and the first political parties were founded. After the first World War, Saad Zaghlul and the Wafd Party led the Egyptian nationalist movement after gaining a majority at the local Legislative Assembly. When the British exiled Zaghlul and his associates to Malta on March 8, 1919, Egypt witnessed its first modern revolution. Constant revolting by the Egyptian people throughout the country led Great Britain to issue a unilateral declaration of Egypt's independence on February 22, 1922.
The new Egyptian government drafted and implemented a new constitution in 1923 based on a parliamentary representative system. Saad Zaghlul was popularly-elected as Prime Minister of Egypt in 1924, and in 1936 the Anglo-Egyptian Treaty was concluded. Continued instability in the government due to remaining British control and increasing political involvement by the king led to the ouster of the monarchy and the dissolution of the parliament in a military coup d'état known as the 1952 Revolution. The officers, known as the Free Officers Movement, forced King Farouk to abdicate in support of his son Fuad.
The Egyptian Republic was declared on 18 June 1953 with General Muhammad Naguib as the first President of the Republic. Naguib was forced to resign in 1954 by Gamal Abdel Nasser – the real architect of the 1952 movement – and was later put under house arrest. Nasser assumed power as President and declared the full independence of Egypt from the United Kingdom on June 18, 1956. His nationalization of the Suez Canal on July 26, 1956 prompted the 1956 Suez Crisis. Three years after the 1967 Six Day War, in which Israel had invaded an occupied Sinai, Nasser died and was succeeded by Anwar Sadat. Sadat switched Egypt's Cold War allegiance from the Soviet Union to the United States, expelling Soviet advisors in 1972, and launched the Infitah economic reform policy, while violently clamping down on religious and secular opposition alike.
In 1973, Egypt, along with Syria, launched the October War, a surprise attack against the Israeli forces occupying the Sinai Peninsula and the Golan Heights in an attempt to liberate the territory Israel had captured 6 years earlier. Both the US and the USSR intervened and a cease-fire was reached between both sides. Despite not being a complete military success, most historians agree that the October War presented Sadat with a political victory that would later allow him to pursue peace with Israel. In 1977, Sadat made a historic visit to Israel which led to the 1979 peace treaty in exchange for the complete Israeli withdrawal from Sinai. Sadat's initiative sparked enormous controversy in the Arab world and led to Egypt's expulsion from the Arab League, but was supported by the vast majority of Egyptians. Sadat was assassinated in Cairo by a fundamentalist military soldier in 1981 and was succeeded by the incumbent Hosni Mubarak. In 2003, the Egyptian Movement for Change, popularly known as Kifaya, was launched to seek a return to democracy and greater civil liberties.