 There followed spells working for General Sir Harold Alexander first as Chief of General Staff, Middle East Command in Cairo and then Chief of General Staff, 18th Army Group during the Tunisia Campaign (1942–43).At Middle East Command Alexander was the British Eighth Army Commander Bernard Montgomery's immediate superior at the time of the Second Battle of El Alamein, in October 1942, and McCreery had a role in the planning of that battle, in which armoured vehicles played such a significant part.McCreery was given command of VIII Corps in the United Kingdom in July 1943 and then, following the Axis surrender in Tunisia, he was given command of X Corps in August 1943 which was training to take part in the Italian Campaign.