Profiting from the civil strife, Austria-Hungary officially annexed Bosnia and Herzegovina in 1908, but pulled its troops out of the Sanjak of Novi Pazar, another contested region between the Austrians and Ottomans, to avoid a war. During the Italo-Turkish War (1911–12) in which the Ottoman Empire lost Libya, the Balkan League declared war against the Ottoman Empire. The Empire lost the Balkan Wars (1912–13). It lost its Balkan territories except East Thrace and the historic Ottoman capital city of Adrianople during the war. Some 400,000 Muslims, out of fear of Greek, Serbian or Bulgarian atrocities, left with the retreating Ottoman army. The Baghdad Railway under German control was a proposal to build rail lines into Iraq. The railway was not actually built at this time but its prospect worried the British until that issue was resolved in 1914. The railway did not play a role in the origins of World War I.