Fürstbistum Ermland
In 1440, the town was one of the founding members of the Prussian Confederation, which opposed Teutonic rule, and upon the request of which King Casimir IV Jagiellon incorporated the territory to the Kingdom of Poland in 1454. The town pledged allegiance to the Polish King and recognized his rule in March 1454 in Kraków. After the subsequent Thirteen Years' War, the Teutonic Knights renounced any claims to the town in the Second Peace of Thorn in 1466. Administratively, it was part of the Prince-Bishopric of Warmia in the new autonomous province of Royal Prussia, later on also in the Greater Poland Province of the Polish Crown. In the 18th century, an anti-German discourse started emerging in the Polish public, while German burghers of Royal Prussia delivered no reason to doubt their allegiance to the Polish Crown.