After officer training at the Royal Military Academy Sandhurst, Barrett was commissioned a second lieutenant in the Lancashire Fusiliers on 11 February 1899. He served with the 2nd Battalion of his regiment in the Second Boer War 1899–1902, including as part of the Ladysmith Relief Force, and was slightly wounded at the engagement at Venters Spruit on 20 January 1900, when he had to take the responsibility as lieutenant, promotion to the rank later confirmed to the same day. The battalion stayed in South Africa throughout the war, which formally ended in June 1902 after the Peace of Vereeniging. Barrett joined other officers and men of the battalion who left Cape Town on the SS "Britannic" in October that year, and was stationed at Aldershot after their return. In 1903 he was promoted to captain, and in June 1903 was seconded as a Wing Officer to the Malay States Guides, a mostly Sikh regiment, stationed in Perak, in the Federated Malay States.