During the Mahdist War, MacDonald commanded a brigade of the Egyptian army in the Dongola Expedition (1896), and subsequently distinguished himself at Abu Hamed (7 August 1897) and Atbara (8 April 1898). At the Battle of Omdurman (2 September 1898) the British commander, Lord Kitchener, unwittingly exposed his flanks to the Dervish (i.e., Mahdist) army. MacDonald swung his men by companies in an arc as the Dervishes charged and by skillful manoeuvring held his ground until Kitchener could redeploy his brigades. When the fight was over MacDonald's troops had an average of only two rounds left per man.