Local dissatisfaction with the Khedive and with European intrusion led to the formation of the first nationalist groupings in 1879, with Ahmad Urabi a prominent figure. After increasing tensions and nationalist revolts, the United Kingdom invaded Egypt in 1882, crushing the Egyptian army at the battle of Tel El Kebir and military occupying the country. Following this, the Khedivate became a de facto British protectorate under nominal Ottoman sovereignty.
In 1899 the Anglo-Egyptian Condominium Agreement was signed: the Agreement stated that Sudan would be jointly governed by the Khedivate of Egypt and the United Kingdom. However, actual control of Sudan was in British hands only.
In 1906, the Dinshaway Incident prompted many neutral Egyptians to join the nationalist movement.
Sultanate of Egypt (1914-1922):
In 1914 the Ottoman Empire entered World War I in alliance with the Central Empires; Khedive Abbas II (who had grown increasingly hostile to the British in preceding years) decided to support the motherland in war. Following such decision, the British forcibly removed him from power and replaced him with his brother Hussein Kamel.
Hussein Kamel declared Egypt’s independence from the Ottoman Empire, assuming the title of Sultan of Egypt. Shortly following independence, Egypt was declared a protectorate of the United Kingdom.
After World War I, Saad Zaghlul and the Wafd Party led the Egyptian nationalist movement to a majority at the local Legislative Assembly.
When the British exiled Zaghlul and his associates to Malta on 8 March 1919, the country arose in its first modern revolution. The revolt led the UK government to issue a unilateral declaration of Egypt’s independence on 22 February 1922.
Kingdom of Egypt (1922-1953):
Following independence from the United Kingdom, Sultan Fuad I assumed the title of King of Egypt; despite being nominally independent, the Kingdom was still under British military occupation and the UK still had great influence over the state.
The new government drafted and implemented a constitution in 1923 based on a parliamentary system. The nationalist Wafd Party won a landslide victory in the 1923-1924 election and Saad Zaghloul was appointed as new Prime Minister.
In 1936, the Anglo-Egyptian Treaty was concluded and British troops withdrew from Egypt, except for the Suez Canal. The treaty did not resolve the question of Sudan, which, under the terms of the existing Anglo-Egyptian Condominium Agreement of 1899, stated that Sudan should be jointly governed by Egypt and Britain, but with real power remaining in British hands.
Britain used Egypt as a base for Allied operations throughout the region, especially the battles in North Africa against Italy and Germany. Its highest priorities were control of the Eastern Mediterranean, and especially keeping the Suez Canal open for merchant ships and for military connections with India and Australia.
The government of Egypt, and the Egyptian population, played a minor role in the Second World War. When the war began in September 1939, Egypt declared martial law and broke off diplomatic relations with Germany. It did not declare war on Germany, but the Prime Minister associated Egypt with the British war effort. It broke diplomatic relations with Italy in 1940, but never declared war, even when the Italian army invaded Egypt. King Farouk took practically a neutral position, which accorded with elite opinion among the Egyptians. The Egyptian army did no fighting. It was apathetic about the war, with the leading officers looking on the British as occupiers and sometimes holding some private sympathy with the Axis. In June 1940 the King dismissed Prime Minister Aly Maher, who got on poorly with British. A new coalition Government was formed with the Independent Hassan Pasha Sabri as Prime Minister.