Egypt remained entirely Ottoman until 1867, except during French occupation from 1798 to 1801. Starting in 1867, Egypt became a nominally autonomous tributary state called the Khedivate of Egypt. However, Khedivate Egypt fell under British control in 1882 following the Anglo-Egyptian War. After the end of World War I and following the Egyptian Revolution of 1919, the Kingdom of Egypt was established. While a de facto independent state, the United Kingdom retained control over foreign affairs, defense, and other matters. British occupation lasted until 1954, with theAnglo-Egyptian agreement of 1954.
The modern Republic of Egypt was founded in 1953, and with the complete withdrawal of British forces from the Suez Canal in 1956, it marked the first time in 2,300 years that Egypt was both fully independent and ruled by native Egyptians. President Gamal Abdel Nasser (president from 1956 to 1970) introduced many reforms and created the short-lived United Arab Republic (withSyria). His terms also saw the Six Day War and the creation of the international Non-Aligned Movement. His successor, Anwar Sadat (president from 1970 to 1981) changed Egypt’s trajectory, departing from many of the political, and economic tenets of Nasserism, re-instituting a multi-party system, and launching the Infitah economic policy. He led Egypt in the Yom Kippur War of 1973 to regain Egypt’s Sinai Peninsula, which Israel had occupied since the Six-Day War of 1967. This later led to the Egypt–Israel Peace Treaty.
Recent Egyptian history has been dominated by events following nearly thirty years of rule by former president Hosni Mubarak. In 2011, Egypt underwent a revolution that deposed Mubarak and resulted in the first democratically elected president in Egyptian history, Mohamed Morsi. Unrest after the 2011 revolution and related disputes led to the 2013 Egyptian coup d’état.