Present-day Latvia was settled by the Balts sometime around 3000 BCE, and their descendants still comprise most of the population. After centuries of being relatively undisturbed, the Livs, Latvians, etc. were the target of a crusade by German knights in the early thirteenth century CE. Foreign rule would continue until after World War I, when an independent Latvian state was created (following a nasty little war). After a brief occupation by Soviet forces (supposedly to protect it from Nazi Germany), it was forcibly annexed to the USSR in 1940, and ceased to exist as a de facto independent state until 1990, although German forces did, ironically enough, briefly seize power during Barbarossa.
As elsewhere the Nazis murdered the Jewish population in the Holocaust. The Soviet Armed Forces retook almost all of Latvia, the exception being the Courland pocket which the Nazis held onto until their formal surrender to the Soviet Union. Latvia was restored but as the Latvian Soviet Socialist Republic. The Soviet Union completed the collectivization of Latvian agriculture and encouraged large numbers of Russians to relocate to Latvia and make the country less Latvian than it had ever been. As in Lithuania, the people wanted their political system to be the Latvian Republic without the "Soviet" and "Socialist" part. Latvians got that wish in 1991 as the Soviet Union disintegrated.