The 5th (Service) Battalion, Wiltshire Regiment was formed at Devizes in August 1914. Soon thereafter, the battalion was assigned to the 40th Brigade of the 13th (Western) Division, taking the place of the 8th Welsh Regiment. With the rest of the division, it transferred in June 1915 from England to the Mediterranean theatre, joining the Mediterranean Expeditionary Force. Initially assigned to reinforce the forces at Cape Helles on 6 July 1915, the division was temporarily withdrawn and then landed at ANZAC Cove to support the operations there. With the rest of the division, it was withdrawn to Egypt in January 1916 before being dispatched to Mesopotamia as part of the ill-fated attempt to relieve the garrison of Kut.