In 1621, after several wars, Riga was conquered by Sweden, the dominant power in the Baltic Sea at the time, though Poland still controlled Eastern Latvia. Then, in 1700 Latvia became caught up in the Great Northern War. This war was fought between Sweden and an alliance made up of Russia, Denmark and Poland. The war began because the alliance, led by Peter the Great, a Tsar who forced modernization on Russia, believed that Sweden, the dominant power in the Baltic, had become weak and that their king Charles XII, who was only 15, would be an easy target.
An artistic impression of Russian and Swedish soldiers fighting during the Great Northern War (Source: Snipview.com)
This proved to be incorrect, and the war was fought on and off for the next 21 years, and ended in 1721 with Russia, Denmark and Poland as the winners. Peter the Great conquered Riga and Northern Latvia, bringing them into the growing Russian Empire. Latvia was then also affected by the Partitions of Poland, in which the weak and unstable Poland was divided between Russia, Prussia, and Austria. In 1772 Eastern Latvia became part of Russia during the First Partition of Poland, and 1795 Courland, in Western Latvia, also became part of Russia.
A map of Eastern Europe following the Great Northern War (Source: zonu.com)
Under Russian rule the German nobles kept their positions, and the Latvian peasants became their serfs, or feudal peasants. While controlled by Russia, Latvian culture still continued to develop, with the first novels published in Latvian in 1879. Riga also becomes an important industrial center of the Russian Empire, with railways being built and a large working class emerging. The Latvian peasants were also affected by the abolition of serfdom in 1861 by Tsar Alexander II, which meant they were no longer bound to their land and their lords. The 1905 revolution in Russia against Tsar Nicholas II triggered by the Bloody Sunday massacre, during which Russian soldiers shot and killed a large number of peaceful protesters who were trying to present a petition to the Tsar, also took place in Latvia, and educated Latvians led an attempted revolution against not only the Russians, but the German nobles as well.
Russian soldiers and protesters in St. Petersburg during the 1905 "Bloody Sunday" Revolution (Source: iconicphotos.wordpress.com)
When soldiers loyal to the Tsar returned from the Russo-Japanese War to crush the revolutionaries they also entered Latvia, executing hundreds of rebels, and forcing even more to flee the country. Nicholas II accepted some of the demands made by his people, but the 1905 revolution set the stage for 1917 and the Bolshevik takeover. Then in 1914 after the shooting of Austrian Archduke Franz Ferdinand, Latvia, along with the rest of the Russian Empire, was dragged into World War I.