Ypres occupied a strategic position during the First World War because it stood in the path of Germany's planned sweep across the rest of Belgium and into France from the north (the Schlieffen Plan). The neutrality of Belgium, established by the First Treaty of London, was guaranteed by Britain; Germany's invasion of Belgium brought the British Empire into the war. The German army surrounded the city on three sides, bombarding it throughout much of the war. To counterattack, British, French, and allied forces made costly advances from the Ypres Salient into the German lines on the surrounding hills.
In the First Battle of Ypres (19 October to 22 November 1914), the Allies captured the town from the Germans. The Germans had used tear gas at the Battle of Bolimov on 3 January 1915. Their use of poison gas for the first time on 22 April 1915 marked the beginning of the Second Battle of Ypres, which continued until 25 May 1915. They captured high ground east of the town. The first gas attack occurred against Canadian, British, and French soldiers, including both metropolitan French soldiers as well as Senegalese and Algerian tirailleurs (light infantry) from French Africa. The gas used was chlorine. Mustard gas, also called Yperite from the name of this town, was also used for the first time near Ypres, in the autumn of 1917.
Of the battles, the largest, best-known, and most costly in human suffering was the Third Battle of Ypres (31 July to 6 November 1917, also known as the Battle of Passchendaele), in which the British, Canadian, ANZAC, and French forces recaptured the Passchendaele Ridge east of the city at a terrible cost of lives. After months of fighting, this battle resulted in nearly half a million casualties to all sides, and only a few miles of ground won by Allied forces. During the course of the war the town was all but obliterated by the artillery fire.
English-speaking soldiers in that war often referred to Ieper/Ypres by the deliberate mispronunciation Wipers. British soldiers even published a wartime newspaper called the Wipers Times. The same style of deliberate mispronunciation was applied to other Flemish place names in the Ypres area for the benefit of British troops, such as Whyteshaete becoming White Sheet and Ploegsteert becoming Plug Street.
Ypres was one of the sites that hosted an unofficial Christmas Truce in 1914 between German and British soldiers.
During World War Two, the British Expeditionary Force (B.E.F.) would fight the Germans in a delaying action at the Ypres-Comines Canal, one of the actions that allowed the Allied retreat to Dunkirk. Adolf Hitler fought at Ypres in the First World War and later visited the town during the Battle of France.