In the 17th and early 18th centuries, the Polish–Lithuanian Commonwealth, Sweden, and Russia struggled for supremacy in the eastern Baltic. After the Polish–Swedish War, northern Livonia (including Vidzeme) came under Swedish rule. Riga became the capital of Swedish Livonia and the largest city in the entire Swedish Empire. Fighting continued sporadically between Sweden and Poland until the Truce of Altmark in 1629. In Latvia, the Swedish period is generally remembered as positive; serfdom was eased, a network of schools was established for the peasantry, and the power of the regional barons was diminished.