Following the outbreak of the Second World War, Lloyd was seconded to the Second Australian Imperial Force (2nd AIF) for overseas service. He held administrative posts in the 6th Division and I Australian Corps in the Middle East during 1940, but was transferred before the 6th Division went into combat for the first time. In December that year, ranked colonel, he was posted to the 9th Division as the senior operational officer, serving as chief of staff to Major General Sir Leslie Morshead. In March, the 9th Division moved into the Western Desert, where they were to finalise their training and prepare to join the British advance through Libya. The landing of German forces around Tripoli in April forced the British and Commonwealth armies into withdrawal from Benghazi as the Afrika Korps arrived to reinforce the Italians in North Africa. The Axis forces subsequently began to advance west towards the strategic port of Tobruk. During the Siege of Tobruk which followed, Lloyd saw action between April and October 1941, until the Australian units were relieved by British forces. Following the evacuation of the 9th Division from Tobruk by sea, Lloyd then served as chief liaison officer at AIF Headquarters, Middle East.