information:extraction
Declaration of independence and interwar period

World War I devastated the territory of what became the state of Latvia, and other western parts of the Russian Empire. Demands for self-determination were initially confined to autonomy, until a power vacuum was created by the Russian Revolution in 1917, followed by the Treaty of Brest-Litovsk between Russia and Germany in March 1918, then the Allied armistice with Germany on 11 November 1918. On 18 November 1918, in Riga, the People's Council of Latvia proclaimed the independence of the new country and Kārlis Ulmanis was entrusted to set up a government and he took the position of prime minister.

The General representative of Germany August Winnig formally handed over political power to the Latvian Provisional Government on 26 November. On 18 November, the Latvian People's Council entrusted him to set up the government. He took the office of Minister of Agriculture from 18 November to 19 December. He took a position of prime minister from 19 November 1918 to 13 July 1919.

The war of independence that followed was part of a general chaotic period of civil and new border wars in Eastern Europe. By the spring of 1919, there were actually three governments: the Provisional government headed by Kārlis Ulmanis, supported by the Tautas padome and the Inter-Allied Commission of Control; the Latvian Soviet government led by Pēteris Stučka, supported by the Red Army; and the Provisional government headed by Andrievs Niedra, supported by Baltic-German forces composed of the Baltische Landeswehr ("Baltic Defence Force") and the Freikorps formation Eiserne Division ("Iron Division").

Estonian and Latvian forces defeated the Germans at the Battle of Wenden in June 1919, and a massive attack by a predominantly German force—the West Russian Volunteer Army —under Pavel Bermondt-Avalov was repelled in November. Eastern Latvia was cleared of Red Army forces by Latvian and Polish troops in early 1920 (from the Polish perspective the Battle of Daugavpils was a part of the Polish–Soviet War).

A freely elected Constituent assembly convened on 1 May 1920, and adopted a liberal constitution, the Satversme, in February 1922. The constitution was partly suspended by Kārlis Ulmanis after his coup in 1934 but reaffirmed in 1990. Since then, it has been amended and is still in effect in Latvia today. With most of Latvia's industrial base evacuated to the interior of Russia in 1915, radical land reform was the central political question for the young state. In 1897, 61.2% of the rural population had been landless; by 1936, that percentage had been reduced to 18%.

By 1923, the extent of cultivated land surpassed the pre-war level. Innovation and rising productivity led to rapid growth of the economy, but it soon suffered from the effects of the Great Depression. Latvia showed signs of economic recovery, and the electorate had steadily moved toward the centre during the parliamentary period. On 15 May 1934, Ulmanis staged a bloodless coup, establishing a nationalist dictatorship that lasted until 1940. After 1934, Ulmanis established government corporations to buy up private firms with the aim of "Latvianising" the economy.