In February 1440 the nobility of Warmia and the town of Braunsberg (Braniewo) co-founded the Prussian Confederation, which opposed Teutonic rule, and most towns of the Prince-Bishopric joined the organization in May 1440. In February 1454, the organization asked Polish King Casimir IV Jagiellon to incorporate the region to the Kingdom of Poland, to which the king agreed and signed the act of incorporation in Kraków on 6 March 1454, and the Thirteen Years' War (1454–1466) broke out. During the war Warmia was recaptured by the Teutonic Knights, however, in 1464 Bishop Paul of Lengendorf sided with Poland and the Prince-Bishopric came again under the overlordship of the Polish King.