The Treaty of Vilnius or Vilna was concluded on 28 November 1561, during the Livonian War, between the Livonian Confederation and the Polish-Lithuanian Commonwealth at Vilnius (Vilna, Wilna, Wilno). With the treaty, the non-Danish and non-Swedish part of Livonia, with the exception of the Free imperial city of Riga, subjected itself to Polish king and Grand Duke of Lithuania, Sigismund II Augustus with the Pacta subiectionis (Provisio ducalis). In turn, Sigismund granted protection from the Tsardom of Russia and confirmed the Livonian estates' traditional privileges, laid out in the Privilegium Sigismundi Augusti.
The secularization of the Livonian Order was the "final act" in Livonia's transition from the Middle Ages to the Early Modern era. The territories were re-organized in the Duchy of Courland and Semigallia and the Duchy of Livonia, the latter competing with the Kingdom of Livonia during the war. After its reconquest, Sigismund's successor Stephen Báthory (Batory) ignored the privileges of 1561, granted a new constitution and initiated counter-reformation. These measures were reversed after the Swedish conquest. When after a further series of wars Livonia capitulated to Russia in 1710, the Privilegium Sigismundi Augusti was confirmed by Peter the Great.