After having been dominated by German rulers, Poland, Sweden and the Russian Empire, the Republic Latvia was declared independant on 18th November 1918 by the government of Karlis Ulmanis. The Soviets saw this government as just a German puppet-state and supported the forming of the Latvian Socialist Sovjet State on 17th December 1918. With the support of the Western Allies and Polish forces, it succeeded in trhowing back the communist forces and the few Germans that were still in Latvia. Ulmanis regained his power on 8th July 1919. In the thirties of the twentieth century, Ulmanis tried to gain more power for the president. His wishes were rejected by the parliament and so he committed a coup on 15th May 1934. In 1936 he became President himself. From this moment Latvia was in fact a dictatorship.
at the outbreak of the Second World War in September 1939, Latvia was forced to take in 30.000 Soviet military. In the summer of 1940 the Soviets demanded a Soviet controlled government to be formed. Elections that were held were directed in such a way that the communist and Soviet-partners gained total power. During the very first session of the new parliament the Latvian Soviet Republic was declared and Ulmanis was arrested and deported to the Caucasus, where he died in 1942.
Germany attacked the Soviet Union on 22ndt June 1941 and Latvia became a German occupied territory. During this reign Latvia gained a mild form of independence. Guided by the hope for a new independency, many Latvians joined the German Army. Two Latvian Waffen-SS divisions were formed, the "XV Waffen-Grenadier-Division der SS Letland No. I" and "XIX Waffen-Grenadier-Division der SS Letland No. II". Soviet forces entered the country again on 30th Jult 1944, but never managed to gain total control over the country before the armistace on 8th May 1945.