Latvia was settled by the Baltic tribes some three millennia ago. The territories along the eastern Baltic first came under foreign domination at the beginning of the 13th century, with the formal establishment of Riga in 1201 under the German Teutonic Knights.

Latvia, in whole or in parts, remained under foreign rule for the next eight centuries, finding itself at the cross-roads of all the regional superpowers of their day, including Denmark (the Danes held on lands around the Gulf of Riga), Sweden, and Russia, with southern (Courland) Latvia being at one time a vassal to Poland-Lithuania as well as Latgale falling directly under Poland-Lithuania rule. Through all this time, Latvia remained largely under Baltic German hegemony, with Baltic Germans comprising the largest land-owners, a situation which did not change until Latvia's independence.

Historically, Latvia has had significant German, Russian, Jewish and Polish minorities. The majority (roughly two thirds) of Latvians, under Swedish influences, adopted Lutheranism, while the minority (the remaining third) of Latvians under Poland-Lithuania, Latgale in particular, retained their Catholicism. Aglona, in Latgale, has been the site of annual Catholic pilgrimage for centuries, even through to today.

Recently introduced immigration law in Latvia provides framework for immigration through investment in various financial areas or real estate. In 2012, solely 2,435[1] applications for residence permit by investment in real estate were received by Office of Citizenship and Migration Affairs. Main immigrant countries are Russia, Belarus, Ukraine and Lithuania (Lithuania is in the European Union, thus no investment is needed). Moreover, Latvia receives residence permit applications from people of nationalities such as Afghans, Chinese, Libyans and people from various other distant countries.

Latvia's indigenous population has been ravaged numerous times throughout history. The earliest such event occurred during the conquest of Latvia by Peter the Great in the Great Northern War with Sweden.

In 1897, the first official census in this area indicated that Latvians formed 68.3% of the total population of 1.93 million; Russians accounted for 12%, Jews for 7.4%, Germans for 6.2%, and Poles for 3.4%. The remainder were Lithuanians, Estonians, Gypsies, and various other nationalities.

The demographics shifted greatly in the 20th century due to the world wars, the repatriation of the Baltic Germans, the Holocaust, and occupation by the Soviet Union. Today, only the Russian minority, which has tripled in numbers since 1935, remains important. The share of ethnic Latvians grew from 77% (1,467,035) in 1935 to 80% (1,508,800), after human loss in World War II and human deportation and other repressive measures, fell strongly to 52% (1,387,757) in 1989.

In 2005, there were even fewer Latvians than in 1989, though their share of the population was larger - 1,357,099 (58.8% of the inhabitants). People who arrived in Latvia during the Soviet era, and their descendants born before 21 August 1991, have to pass a naturalisation process to receive Latvian citizenship. Their children born after the restoration of independence in 1991 are registered as citizens, if one of the parents requests it.

Ethnic Latvians have been one of the world's slowest-growing ethnic groups for a century. The number of Latvians today is actually less than it was in the 1920s.

Over 130,000 persons have been naturalized as Latvian citizens since 1995, but 290,660 persons, as of March 2011, live in Latvia with non-citizen's passports. Large numbers of Russians, as well as some Ukrainians and Belarusians remained in Latvia after the fall of the Soviet Union.

According to the provisional results of the Population and Housing Census 2011, the total population of Latvia on 1 March 2011 was 2,067,887. Since the previous census in 2000 the country's population decreased by 309 thousand or 13%. The proportion of ethnic Latvians increased to 62.1% of the population.[2]Livonians are the other indigenous ethnic group, with about 100 of them remaining. Latgalians are a distinctive subgroup of Latvians inhabiting or coming from Eastern Latvia.

According to rankings provided by the United States Census Bureau—International Data Base (IDB)—Country Rankings, Latvia is estimated to have a population of 1,249,812 in the year 2050.[3]

Illegal immigration in Latvia has traditionally been from neighboring countries such as Russia but now migrants also come from other areas such as Latin America, Southeast Asia and Africa.[4] The Latvian government have sought to work with Russia to stem the problem.[5] The Latvian government has been criticized for its treatment of illegals[6][7]

For an immigrant not to become an illegal resident, a permit is required for a foreign national or a stateless person wishing to reside in the Republic of Latvia for more than 90 days within a 6-month period,[8] thus if the person does not acquire himself a residence permit, he will be considered an illegal immigrant.

Latvians have always been the largest ethnic group in Latvia during the past century, but minority peoples have always been numerous. Before WW II the proportion of non-Latvians was approximately 25%, the Russians being the largest minority (app. 10%), followed by Jews (approx. 5%), Germans and Poles (2–3%). After World War 2 only small numbers of Jews and Germans remained and following a massive immigration of Russians, Ukrainians and Belarusians, Latvians almost became a minority. In 1989, the proportion of Latvians had decreased to only 52% (from 75.5% in 1935). Despite the decreasing number of Latvians due to low fertility rates, the proportion of Latvians has considerably increased during the past two decades and reached 62.1% in 2011 (slightly higher than the 62.0% in 1959). This is due to large scale emigration of Russians, Ukrainians and Belarusians. The number of these peoples almost halved between 1989 and 2011.

In the 2011 census, 1,164,894 persons in Latvia reported Latvian as their main language spoken at home; 698,757 respondents listed Russian as their main language spoken at home,[19] representing 37.2% of the total population, whereas Latvian was recorded as the main language spoken at home for 62.1%.[20] Latvian was spoken as a second language by 20.8% of the population, and 43.7% spoke Russian as a second language.[21] In total, 71% of ethnic Latvians said they could speak Russian, and 52% of Russians could speak Latvian in census 2000.[22]

In a 2005 survey, 24.1% described themselves as Russian Orthodox, 20.7% Catholics, 20.0% Lutherans, 4.4% Old Believers, 10.6% non-denominational believers and 15.8% non-believers.[23] Lutheranism was the majority religion before World War II, but has now fallen to third place behind Russian Orthodoxy and Catholicism.