William Campbell was commissioned into the King's Royal Rifle Corps in 1875. He served with the Mounted Infantry Camel Corps in Sudan between 1884 and 1885. His battalion served in South Africa between 1899 and 1901 during the Second Boer War. At the Battle of Talana Hill he was wounded and his commanding officer was killed. As second in command, he took command of his battalion and was part of the garrison besieged at Ladysmith. He was subsequently promoted to Lieutenant Colonel in command of the 1st Battalion on 25 January 1900.