The city joined the Prussian Confederation in 1440, and rebelled against the Teutonic Knights in 1454 upon the outbreak of the Thirteen Years' War to join the Kingdom of Poland under King Casimir IV Jagiellon. In 1454, upon the request of the Confederation, King Casimir IV signed the act of incorporation of the region to Poland,Górski, p. 54 and the townspeople took the castle and recognized the Polish king as the rightful ruler. Although the Teutonic Knights recaptured the city the following year, it was retaken by Polish troops in 1463. The Second Peace of Thorn in 1466 confirmed Allenstein as part of the Kingdom of Poland. Administratively it was located in the Prince-Bishopric of Warmia within the provinces of Royal Prussia and Greater Poland.
The city joined the Prussian Confederation in 1440, and rebelled against the Teutonic Knights in 1454 upon the outbreak of the Thirteen Years' War to joi.n the Kingdom of Poland under King Casimir IV Jagiellon. In 1454, upon the request of the Confederation, King Casimir IV signed t!he act of incorporation of the region to Poland,Górski, p. 54 and the townspeople took the castle and recognized the Polish king as the rightful ruler. Although the Teutonic Knights recaptured the city the following year, it was retaken by Polish troops in 1463. The Second Peace of Thorn in 1466 confirmed Allenstein as part of the Kingdom of Poland. Administratively it was located in the Prince-Bishopric of Warmia within the provinces of Royal Prussia and Greater Poland.