In 1656, during the early Second Northern War, the Brandenburgian Hohenzollern took the Prussian duchy and Ermland (Ermeland, Warmia) as Swedish fiefs in the Treaty of Königsberg, before the Swedish king released them from the vassalage and made them absolute sovereigns in those provinces. After fighting along with the Swedish Army in 1656, most prominently at the Battle of Warsaw, Hohenzollern Frederick William I was willing to abandon his ally when the war had turned against them and signalled his willingness to change sides if Polish King John II Casimir Vasa would grant him similar privileges as previously Swedish King Charles X Gustav, conditions that were negotiated in Wehlau (Welawa, now Znamensk) and Bromberg (Bygost, Bydgoszcz).