The German Army marched into Riga and captured it in 1917. In 1918 after the Russian surrender, Riga was made a part of the German Empire. On 11 November 1918, Germany surrendered and gave up Latvia. Latvia declared independence on 18 November. The United Kingdom and Germany were Latvia's main trading partners.