In the VII century, Scandinavian settlements appeared in western Latvia in Kurzeme.
In the VIII century, the population of Latvia from dugouts moved to the hut, to the X century, mastered the technology of potter’s wheel. The findings of the Arab dirhams (starting from the second half of the 9th century) indicate increased trade and economic ties with distant countries. Roman coins in the territory of Latvia appeared in the II century A.D.
By the 12th century, there were a number of proto-state formations (Mežotne, Tervete, Yersik, Tālava, Koknese, etc.). In each of these lands there was at least one well-fortified castle.
In the XI-XII centuries, the struggle for political influence over the ancient Latvian lands was joined by the Russian principalities. The presence of Russian political influence was felt on the territory of modern Latvia during this period, although it is difficult to determine its boundaries. Such strong princedoms as Koknese and Yersik were dependent on the Polotsk principality, which controlled the trade route along the Western Dvina. Livas, who lived at the very mouth of the Dvina, also paid tribute to the Prince of Polotsk. The lands of Tālava and Atzel paid tribute to the Pskov prince. At the same time, the princes and elders of the Zemgals and Kursa were politically relatively independent, although some Curonians paid tribute to the kings of Sweden.
From the second half of the 12th century on the territory of eastern Latvia, Russian missionaries preached the Christian faith in the Orthodox version, but the locals reluctantly departed from pagan beliefs. The Germans achieved greater success in this field: in the era of the crusades, the Christians of Western Europe set out to convert the northern pagans to Christianity. In 1185, the first bishopric was founded, in 1201, at the direction of Bishop Albert, Riga was founded. In 1198, Pope Innocent III issued a bull about the beginning of a crusade on the Baltic lands.
Order period (1202-1561)
In the period from the end of the XII to the end of the XIII century, the territory of present-day Latvia was conquered by the crusaders of the Order of the Swordsmen (from 1237 the Livonian Order) and became part of Livonia. The territory of Livonia was covered with a network of stone castles, which were used by conquerors as strongholds. The Crusaders brought with them Catholicism; of the Germans who settled here, the ruling classes (nobility and clergy) were formed, while the Germans became the basis of the urban population. Until the 15th century, local peasants retained relative freedom and were often hired into the military structures of the order, but by the end of the 16th century all peasants became serfs.
Under the rule of the Commonwealth and Sweden (1561-1721)
One of the factors weakening the Livonian Order was the Reformation. The Order was subordinate to the head of the Roman Catholic Church, but the majority of its members were Germans , who were inspired by the preaching of their fellow countryman Martin Luther. The end of Livonia came during the Livonian War, which began with the invasion of the army of the Russian Tsar Ivan the Terrible in 1558.
At the same time, Poland declared itself to be the bastion of the Counter-Reformation and Catholicism. The Lutheran declared protector Swedish king. Thus, the Counter-Reformation in Latvia turned into a Polish-Swedish confrontation, which reached its peak in the Polish-Swedish wars (1600-1629). As a result of the war, the territory of modern Latvia was divided between two countries: Riga and Livonia became Swedish, and Kurland and Latgale remained behind the Commonwealth.
The end of the confrontation put the arrival of a third force – the Russian Empire, which during the Northern War in 1710 occupied the territory of Estland and Livonia, and in 1721, according to the Nystad peace treaty, legally secured a part of the territory of modern Latvia belonging to Sweden (including Riga).
As part of the Russian Empire (1721-1917)
The Swedish Livonia received by the peace treaty in 1721 (which included the northern part of modern Latvia and the southern modern Estonia) in the Russian Empire became part of the Riga province, and then a separate Livonia province. In 1772, as a result of the first division of the Polish-Lithuanian Commonwealth, Latgale (Polish Inflanta) was annexed to Russia, and in 1795 – Kurland.
During the invasion of Napoleon, French troops temporarily occupied Kurland, but they could not take Riga. Soon after the Patriotic War of 1812, serfdom was abolished in most parts of Latvia.
In the second half of the XIX century, the industrialization of the Baltic lands. In 1861 the first railway between Riga and Daugavpils was carried out, which was subsequently continued to Vitebsk. In 1862 the Riga Polytechnic was founded. Riga had become an industrial center where many factories were built (including the famous Russo-Balt). However, the Germans remained at the head of the local elite. At the same time, the wave of national revival sweeping across Europe affected the territory of present-day Latvia. Marxist circles also appeared in the factories.