The territory, which constituted the southern part of modern Estonia (including the island of Ösel ceded by Denmark after the Treaty of Brömsebro) and the northern part of modern Latvia (the Vidzeme region), represented the conquest of the major part of the Polish-Lithuanian Duchy of Livonia during the 1600–1629 Polish-Swedish War.Parts of Livonia and the city of Riga were under Swedish control as early as 1621 and the situation was formalized in the Truce of Altmark 1629, but the whole territory was not ceded formally until the Treaty of Oliva in 1660.Together with other Baltic Sea dominions, Livonia served to secure the Swedish dominium maris baltici.In contrast to Swedish Estonia, which had submitted to Swedish rule voluntarily in 1561 and where traditional local laws remained largely untouched, the uniformity policy was applied in Swedish Livonia under Karl XI of Sweden: serfdom was abolished, peasants were offered education as well as military, administrative or ecclesiastical careers, and nobles had to transfer domains to the king in the Great Reduction.The territory in turn was conquered by the Russian Empire during the Great Northern War and, following the Capitulation of Estonia and Livonia in 1710, formed Riga Governorate.