Fighting began in North Africa on September 13, 1940, when Marshal Rodolfo Graziani's Italian 10th Army launched an attack from its bases in Libya on outnumbered British forces in western Egypt. A successful British counterattack initiated on December 9, 1940, led by General Sir Archibald Wavell, resulted in Italian defeat at Tobruk (Tubruq) in eastern Libya on January 22, 1941. On February 12, 1941, German General Erwin Rommel arrived in Libya to take command of troops sent to reinforce Germany's Italian allies. The German units were rapidly expanded to the size of an Army Corps and renamed the Deutsches Afrika Korps (German Africa Corps).

Panzer tanks of Erwin Rommel's Africa Corps during an advance against British armed forces.

On March 24, 1941, Rommel launched an offensive, and, bypassing Tobruk, reached the Egyptian border on April 14. There, the opposing British and German-Italian armies remained stalemated until November 1941. Taking advantage of the diversion of human and material resources from North Africa to the eastern front in Europe in the summer and autumn of 1941, a reorganized British Eighth Army (consisting of British, Australian, Indian, South African, New Zealander, and Free French soldiers) attacked Rommel's positions in what was known as Operation “Crusader.” After early reverses, the British drove the Axis armies back into Libya, relieved the garrison in Tobruk, and forced Rommel to pull back on January 6, 1942, to El Agheila (on the border of the Libyan provinces of Cyrenaica and Tripolitania).

The ability of the Germans to shift resources to North Africa after stabilizing the eastern front in January 1942 and the diversion of British resources to meet the Japanese threat in the Pacific after December 7, 1941, enabled Rommel to launch a second offensive on January 21, 1942. Axis troops reached Al-Gazala, just west of Tobruk, within two weeks.

On May 26, 1942, German and Italian troops launched another offensive, Operation “Venezia,” that enabled them to encircle Tobruk and drive Allied forces back to the Egyptian border. Tobruk fell on June 21, and Rommel's forces pursued the British into Egypt. During the course of July 1942, the British halted the Axis armies at El Alamein. Despite the British success in stopping Rommel, British prime minister Winston Churchill replaced his top military commanders in the Middle East, appointing General Sir Harold Alexander as commander in chief of British forces in the Middle East and Lieutenant General Sir Bernard L. Montgomery as commander of the Eighth Army.

General Bernard L. Montgomery, commander of British forces in Egypt, watches British tanks move toward German lines during the military ...

On August 30, 1942, the Axis launched its final offensive of the Western Desert campaign. On September 3, the British halted the Axis units at the battle of Alam el Halfa, just south of El Alamein. After amassing troops and supplies, including new US-supplied tanks, Montgomery attacked Rommel's forces at El Alamein on October 23, 1942. Ten days later, the Axis forces were forced to withdraw. Hoping to preserve his fighting forces for combat from a better strategic position, Rommel retreated rapidly across Libya, abandoning the Libyan capital, Tripoli, on January 23, 1943, and reaching the Tunisian border a week later.