Ottoman rule over Iraq lasted until the World War I when the Ottomans sided with Germany and the Central Powers. In the Mesopotamian campaign against the Central Powers, British forces invaded the country and suffered a major defeat at the hands of the Turkish army during the Siege of Kut (1915–16). British forces regrouped and captured Baghdad in 1917. An armistice was signed in 1918.