sentences:  Poles recaptured the town after the Battle of Grunwald in 1410, however, after the 1411 peace treaty it fell back to the Teutonic Knights.In 1440 the town joined the Prussian Confederation, which opposed Teutonic rule, and upon the request of which King Casimir IV Jagiellon re-incorporated the territory to the Kingdom of Poland in 1454.During the subsequent Thirteen Years' War it was captured by the Teutonic Knights in 1458, besieged by Poles in August 1464, and the Teutonic Knights capitulated in February 1465, losing their last stronghold on the west bank of the Vistula.