Since 9,000 BC ancient peoples of unknown origin had inhabited Latvia, but by 3,000 BC the ancestors of the Finns had settled the region. A millennium later, pre-Baltic tribes had arrived and within time evolved into the Baltic Couranian, Latgallian, Selonian, and Semigallian groups. These tribes eventually formed local governments independently from the Finno-Ugric Livian tribe until the thirteenth century, when they were conquered by the Germans, who renamed the territory Livonia.
German sailors shipwrecked on the Daugava River in 1054 had inhabited the area, which led to increasing German influence. Founded by the Germanic Bishop Alberth of Livonia in 1201, Riga joined the Hanseatic League in 1285 and shared important cultural and economic ties to the rest of Europe. However, the new German nobility enserfed the peasantry and accorded non-Germanic peoples only limited trading and property rights.
Subsequent wars and treaties ensured Livonia's partition and colonization for centuries. The Commonwealth's successes during the Livonian Wars (1558-1583) united the Latvian-populated duchies of Pardaugava, Kurzeme, and Zemgale, but the Polish-Swedish War (1600-1629) granted Sweden acquisition of Riga and the Duchy of Pardaugava, minus Latgale, leaving Latvia again split ethnically. In turn, victory over Sweden in the Great Northern War (1700-1721) gave Russia control over the Latvian territories. From 1804 onwards, a series of local decrees gradually weakened the grip of German nobility over peasant society, and in 1849 a law granted a legal basis for the creation of peasant-owned farms.
Until the 1860s, there still was little sense of a Latvian national identity, as both serfdom and institutional controls to migration and social mobility limited the boundaries of the peasants' intellectual and social geography. The large baronic estates caused a lack of available farmland for an increasing population, creating a large landless, urban class comprising about 60% of the population. Also in the face of stricter Russification policies, the Baltic German clergy and literati began to take a more benevolent interest in the distinctive language and culture of the Latvian peasantry. These patrons (with such Lettish names as Alunans, Barons, Krastins, Kronvalds, Tomsons and Valdemars) soon formed the Young Latvian Movement, whose aim was to promote the indigenous language and to publicize and counteract the socio-economic oppression of Latvians.
By 1901, "Jauna Strava" had evolved into the Latvian Social Democratic Party. Following the lead of the Austrian Marxists, the LSDP advocated the transformation of the Russian Empire into a federation of democratic states (to include Latvia) and the adoption of cultural autonomy policy for extra-territorial ethnic communities. In 1903, the LSDP split into the more radically internationalist Latvian Social Democratic Worker's Party and the more influential Latvian Social Democratic Union (LSDU), which continued to champion national interests and Latvia's national self-determination, especially during the failed 1905 Revolution in Russia.
The onset of WWI brought German occupation of the western coastal province of Kurzeme, and Latvians heroically countered the invasion with the establishment of several regiments of riflemen commanded by Czarist generals. As a defensive measure, Russia dismantled over 500 local Latvian industries, along with technological equipment, and relocated them to central Russia. The sagging military campaign generally increased Latvian and LSDU support for the Bolsheviks' successful October Revolution in 1917, in the hopes of a "free Latvia within free Russia." These circumstances led to the formation of the soviet "Iskolat Republic" in the unoccupied section of Latvia. In opposition to this government and to the landed barons' German sympathies stood primarily the Latvian Provisional National Council and the Riga Democratic Bloc. These and other political parties formed the Latvian People's Council which on November 18, 1918 declared Latvia's independence and formed an army.
The new Latvian army faced rogue elements of the retreating German army and squared off in civil war against the Soviet Red Army, comprised greatly of the former Latvian Riflemen. Soviet power resumed in Latvia one month later on December 17 by order of the Latvian SSR, which forcefully collectivized all land and nationalized all industries and property. By May 22, 1919 the resurgent German Army occupied and devastated Riga for several days. In response, the Latvian army managed to win a decisive battle over the combined German-Red Army forces and thereafter consolidated its success on the eastern Latgale front. These developments led to the dissolution of the Soviet Latvian government on January 13, 1920 and to a peace treaty between Latvia and Soviet Russia on August 11 later that year. By September 22, 1921, Latvia was admitted to the League of Nations.
Having obtained independent statehood in which Latvians were an absolute majority, the Government headed by Prime Minister Ulmanis declared a democratic, parliamentary republic. It recognized Latvian as the official language, granted cultural autonomy to the country's sizeable minorities, and introduced an electoral system into the Latvian constitution, which was adopted in 1922. The decade witnessed sweeping economic reform, as war had devastated Latvian agriculture, and most Russian factories had been evacuated to Russia. Economic depression heightened political turmoil, and on May 15, 1934, Prime Minister Ulmanis dismissed the parliament, banned outspoken and left-wing political parties and tightened authoritarian state control over Latvian social life and the economy.
The effects of the infamous Molotov-Ribbentrop agreement of 1939 steadily forced Latvia under Soviet influence until August 5, 1940, when the Soviet Union finally annexed Latvia. On June 14 of the following year 15,000 Latvian citizens were forcibly deported and a large number of army officers shot. The subsequent German occupation witnessed the mobilization of many Latvians into Waffen SS legions, while some Latvians joined the Red Army and formed resistance groups; others fled to the West and East. By 1945, Latvia's population dropped by one-third.
After the war, the U.S.S.R. subjected the Latvian republic to a scale of social and economic reorganization which rapidly transformed the rural economy to heavy industry, the strongly ethnically Latvian population into a more multiethnic structure, and the predominantly peasant class into a fully urbanized industrial worker class. As part of the goal to more fully integrate Latvia into the Soviet Union, on March 25, 1949 Stalin again deported another 42,000 Latvians and continued to promote the policy of encouraging Soviet immigration to Latvia. The brief "Krushchev thaw" of the 1950's ended in 1959, when the Soviets dismissed Latvian Communist Party and Government leaders on charges of "bourgeois nationalism" and replaced them with more aggressive hardliners, mostly from Russia.
"Perestroika" enabled Latvians to pursue a bolder nationalistic program, particularly through such general issues as environmental protection. In July 1989, the Latvian Supreme Soviet adopted a "Declaration of Sovereignty" and amended the Constitution to assert the supremacy of its laws over those of the U.S.S.R. Pro-independence Latvian Popular Front candidates gained a two-thirds majority in the Supreme Council in the March, 1990 democratic elections. On May 4, the Council declared its intention to restore full Latvian independence after a "transitional" period; three days later, Ivars Godmanis was chosen Council of Ministers Chairman, or Prime Minister.
In January 1991, Soviet political and military forces tried unsuccessfully to overthrow the legitimate Latvian authorities by occupying the central publishing house in Riga and establishing a "Committee of National Salvation" to usurp governmental functions. Seventy-three percent of all Latvian residents confirmed their strong support for independence March 3 in a nonbinding "advisory" referendum. A large number of ethnic Russians also voted for the proposition.
Latvia claimed de facto independence on August 21, 1991 in the aftermath of the failed Soviet coup attempt. International recognition, including the U.S.S.R., followed. The U.S., which had never recognized Latvia's forcible annexation by the U.S.S.R., resumed full diplomatic relations with Latvia on September 2.