While human habitation in the region dates back to at least 9000 BC, the first forebears of Latvia's present inhabitants were Finno-Ugric hunters who probably reached the area between 3000 and 2000 BC. The ancestors of the modern Latvians, known as Balts, probably showed up around 2000 BC.
In the first few centuries AD the tribes of the region traded with Germanic tribes and the Roman Empire. Later, they traded with and fought against Vikings and Russians. By the 12th century the Finno-Ugric and Balt peoples were split into a number of tribal groups, all practising nature religions. Following papal calls for a crusade against the northern heathens, Germanic missionaries arrived in the area but achieved little until the 13th century. The Knights of the Sword (later known as the Livonian Order), an order of crusading knights whose white cloaks were emblazoned with blood-red swords and crosses, forcibly converted the region by 1290. Latvia was subject to continuous foreign rule from the 13th to the 20th century.
Protestant Sweden and Catholic Poland-Lithuania settled down in 1592 to fight each other in the Baltic lands. Most of eastern Latvia, including Riga, ended up in Swedish hands. The period of Swedish rule is looked back on fondly as a relatively enlightened episode in the country's long history of oppression. The 17th-century Swedish kings raised Latvian peasants from serfdom and introduced universal education. The liberation of the serfs triggered a Latvian national revival by allowing native people to move into trades, professions, commerce and intellectual circles. Slowly, Latvia emerged as a political entity in its own right, despite the unpopular and oppressive process of Russification towards the end of the 19th century.
Latvia was subject to German occupation during WWI, but on 18 November 1918, just 7 days after Germany surrendered to the Allies, peasant, middle-class and socialist groups declared independence, and Karlis Ulmanis, head of the Farmers' Party, formed a government. However, fighting continued between nationalists, Bolsheviks and Baltic Germans until 1920, when Soviet Russia signed a peace treaty with the parliamentary republic of Latvia, recognising its independence in perpetuity.
By the early 1930s Latvia had lapsed into authoritarianism, and on 23 August 1939 (when Nazi Germany and the USSR signed a nonaggression pact) Latvia was placed in the Soviet sphere of influence. By August 1940 the nation had been placed under Soviet military occupation, communists had won 'elections', and Latvia had been 'accepted' as a republic of the USSR. Nationalisation and purges began, and within a year 35,000 Latvians had been killed, deported or had fled the country. Germany invaded the USSR and occupied Latvia in 1941.
Though many Latvians considered the Nazis liberators and enlisted in German military units, Latvia's 90,000-strong Jewish population was virtually wiped out. A large number of Latvians fled to the West in 1944 and 1945 to avoid the Red Army's reconquest of their country, but Latvia's total losses during WWII were still around 450,000. Under Stalin, another 175,000 Latvians were killed or deported between 1945 and 1949.
The first signs that the harsh Soviet rule of Latvia was relaxing came in the late 1980s, when Mikhail Gorbachev started to encourage glasnost (openness) and perestroika (restructuring). Decades of pent-up bitterness emerged along with mass demands for self-rule. In 1988, Latvian government members joined public meetings and rallies, while a popular front pressing for democratic reform won a huge following. In spring 1990 nationalists won a large majority in the Latvian parliament and reinstated the pre-WWII constitution but declared a transition period for full independence. In early 1991 a referendum resulted in a large majority favouring secession from the USSR, and on 21 August, two days after a coup attempt against Gorbachev in Moscow, Latvia declared full independence. This was recognised by the West and, finally, by the USSR on 6 September 1991. Latvia joined the United Nations less than 2 weeks later. The last Russian troops pulled out in 1994.
Formal Russian recognition of Latvian independence was achieved in 1996 in exchange for Latvia reluctantly conceding the Abrene (Russian: Pytalovo) region - a sliver of country running down its northeastern border. Latvia began to look towards Europe, courting EU membership by scrapping a law requiring those those in political office to speak Latvian.
Latvia's slow about-face from east to west reached two critical milestones in 2004, when in March it was formally accepted into NATO and then again two months later into the European Union.
Meanwhile, one of the major issues confronting the government is the question of the rights of the country's Russian minority. A move in February 2004 to restrict the teaching of Russian in Latvian schools was met with protests, while many of the one-third of the population who identify as ethnic Russian have yet to take up Latvian citizenship.
