 After the peace treaty signed in Toruń in 1466 it came under Polish suzerainty as a fief, remaining part of the Order's State, until the conversion of Grand Master Albert von Hohenzollern to Lutheranism in 1525, whereafter the town became part of the Protestant Duchy of Prussia, also a Polish fief.During the Polish–Teutonic War (1519–21), the town was captured by Polish troops under Hetman Mikołaj Firlej, who confirmed the town privileges.During the Second Northern War it was plundered by Swedish troops in 1656.