During World War I, the German Empire was one of the Central Powers that lost the war. It began participation in the conflict after the declaration of war against Serbia by its ally, Austria-Hungary. German forces fought the Allies on both the eastern and western fronts, although German territory itself remained relatively safe from widespread invasion for most of the war, except for a brief period in 1914 when East Prussia was invaded. A tight blockade imposed by the Royal Navy caused severe food shortages in the cities, especially in the winter of 1916–17, known as the Turnip Winter. At the end of the war, Germany's defeat and widespread popular discontent triggered the German Revolution of 1918–19 which overthrew the monarchy and established the Weimar Republic.