structural:expansion, information:classification, structural:summarization, stylistic:style_transfer
World War I

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.Between World War I and World War II (1918–1940), Riga and Latvia shifted their focus from Russia to the countries of Western Europe. The United Kingdom and Germany replaced Russia as Latvia's major trade partners. The majority of the Baltic Germans were resettled in late 1939, prior to the occupation of Estonia and Latvia by the Soviet Union in June 1940.