After their defeat at the Battle of Grunwald, the Teutonic Knights according to the 1411 Peace of Thorn had to pay large contributions to the Polish kings, which strongly affected the public budget. In view of rising taxes, several local nobles and Hanseatic cities in 1440 established the Prussian Confederation at Marienwerder (Kwidzyn) protesting against the Order's internal and financial policies. The Confederation was led by the citizens of Danzig, Elbing, and Thorn. The gentry from Chełmno Land and Pomerelia participated as well. Grand Master Ludwig von Erlichshausen demanded the dissolution and in 1453 searched for help from Pope Nicholas V and Emperor Frederick III. In turn, in February 1454, the Confederation sent a delegation, under Johannes von Baysen (Jan Bażyński), to King Casimir IV Jagiellon of Poland, to ask him for support against the Teutonic Order's rule and for incorporation of their homeland into the Kingdom of Poland. In this act, Prussian delegates declared the Polish king the only true heir of those lands, parts of which were earlier illegally separated from Poland. After some hesitation and negotiating the exact conditions of incorporation on 6 March 1454, the Royal Chancellery issued the Act of Incorporation that met the requests of the Prussian estates represented by the Confederation.

Prussian-Polish Alliance

After the Prussian Confederation pledged allegiance to Casimir on 6 March 1454, the Thirteen Years' War ("War of the Cities") begun. King Casimir IV Jagiellon appointed Baysen as the first war-time governor of Royal Prussia. On 28 May 1454 the king took an oath of allegiance from the citizens of Toruń and in June a similar oath from the citizens of Elbing and Königsberg.

The rebellion also included major cities from the eastern part of the Order's lands, such as Kneiphof (Knipawa), later a part of Königsberg. Though the Knights were victorious at the 1454 Battle of Chojnice, they were not able to finance further mercenaries in order to reconquer the castles occupied by the insurgents. Thirteen years of attrition warfare ended in October 1466 with the Second Peace of Toruń, which provided for the Order's cession to the Polish Crown of its rights over the western half of Prussia, including Pomerelia and the districts of Elbing, Marienburg and Chełmno.

Polish Crown

According to the 1454 Incorporation Statute issued by King Casimir IV, Royal Prussia enjoyed substantial autonomy as part of the Crown of Poland, it had its own treasury and monetary unit and armies. It was governed by a council, subordinate to the Polish king, whose members were chosen from local lords and wealthy citizens (ius indigenatus). Prussians had also seats provided for them in Polish Diet, but they chose not to use this right until the Union of Lublin. Toruń, Elbing and Danzig (Danzig law) gained privileges similar to the status of a Free imperial city.

The Bishop of Warmia had claimed the title of an Imperial Prince-Bishopric status, as mentioned in the Golden Bull of 1356 by Emperor Charles IV. Although the area was never directly under the Emperor's jurisdiction and the claim seems unsupported by any bestowal document, it was in wide use in the 17th century. The bishopric continued defending this status until the end of the Holy Roman Empire in 1806.

The eastern part of Prussia remained under the rule of the Teutonic Knights and its successors as a fief of Poland, becoming the Ducal Prussia in 1525 when the Order's last Grand MasterAlbert von Hohenzollern adopted Lutheranism and secularized the land as its hereditary ruler. In 1618 the duchy was inherited by John Sigismund von Hohenzollern. It remained under Polish (and briefly Swedish) suzerainty and the rulers of Brandenburg had to swear – in the role as Prussian duke – formal allegiance to the Polish Crown. The dukes, in personal union electors of Brandenburg (vassals to the Holy Roman Emperor), achieved sovereignty for the duchy in the Treaty of Wehlau (1657).