When Italy declared war on 10 June 1940, the Italian Army in Libya threatened the vital Suez Canal in British-occupied Egypt. The new battlefield was characterised by huge distances, difficult terrain and an inhospitable climate.
Italian forces attacked Egypt on 13 September. General O’Connor’s Western Desert Force was outnumbered, but his commander-in-chief, General Wavell, ordered a surprise attack at Sidi Barrani three days later. By 9 February 1941, O’Connor had advanced hundreds of miles and taken 130,000 prisoners.
The British Army in North Africa, 1942

Crusader tanks and other vehicles out on patrol in the Western Desert, 26 August 1942.
With his Italian ally reeling, Hitler sent General Rommel and the Afrika Korps to North Africa, just as Churchill had ordered most of Wavell’s troops to Greece. Rommel attacked in March, driving the British back to Egypt. Wavell was replaced by General Auchinleck as commander-in-chief, Middle East, on 1 July 1941, and the Western Desert Force was reformed as the Eighth Army.
The British launched Operation ‘Crusader’ on 18 November to relieve the besieged port of Tobruk. Both sides suffered heavily and Rommel withdrew to re-equip. On 21 January 1942, he counter-attacked, defeating the British at Gazala and Bir Hacheim, and taking Tobruk and over 30,000 prisoners. Defeated again at Mersa Matruh, the Eighth Army withdrew to El Alamein, causing panic in Cairo and the Mediterranean Fleet to evacuate Alexandria.
A German attack on 1 July was held, and General Bernard Montgomery arrived to command the Eighth Army, with General Harold Alexander taking over as commander-in-chief, Middle East. Montgomery held Rommel at Alam Halfa in August and attacked on 23 October. In the Battle of El Alamein, Rommel was decisively beaten and retreated into Tunisia.