By the 10th century, the area that is today Latvia was inhabited by several Baltic tribes who had formed their own local governments. In 1054, German sailors who shipwrecked on the Daugava River inhabited the area, which initiated a period of increasing Germanic influence. The Germans named the territory Livonia. In 1201, Riga, the current capital of Latvia, was founded by the Germanic Bishop Alberth of Livonia; the city joined the Hanseatic League in 1285 and began to form important cultural and economic relationships with the rest of Europe. However, the new German nobility enserfed the indigenous people and accorded them only limited trading and property rights.
Subsequent wars and treaties led to Livonia's partition and colonization for centuries. In 1721 Russia took control over the Latvian territories as a result of its victory over Sweden in the Great Northern War. During this time there was little sense of a Latvian national identity, as both serfdom and institutional controls to migration and social mobility limited the boundaries of the indigenous people's intellectual and social geography. However, in the 1860s, the Young Latvian Movement was formed in order to promote the indigenous language against Russification policies and to publicize and counteract the socioeconomic oppression of Latvians, 60% of whom belonged to the landless, urban class. This growing proletariat became fertile ground for the ideas of western European socialism and supported the creation in 1903 of the 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.