The 20th century brought World War I and the impact of the Russian Revolution of 1917 to Riga. As a result of the battle of Jugla, the German army marched into Riga on 3 September 1917. On 3 March 1918, the Treaty of Brest-Litovsk was signed, giving the Baltic countries to Germany. Because of the Armistice with Germany of 11 November 1918, Germany had to renounce that treaty, as did Russia, leaving Latvia and the other Baltic States in a position to claim independence. Latvia, with Riga as its capital city, thus declared its independence on 18 November 1918.