The Ottoman Empire, recognising defeat in World War I by October 1918, signed the Armistice of Mudros with the British (30 October 1918); this meant the evacuation of Turkish forces from Baku. Headed by General  William Thomson, some 5,000 British troops, including parts of the former Dunsterforce, arrived in Baku on 17 November. Thomson declared himself military governor of Baku and implemented martial law in the city until "the civil power would be strong enough to release the forces from the responsibility to maintain the public order". British forces left before the end of 1919.