The War of the Priests (1467-1479, German: Pfaffenkrieg, Polish: wojna popia, wojna księża) was a conflict in the Polish province of Warmia between the King of Poland Casimir IV and Nicolaus von Tüngen, the new bishop of Warmia chosen – without the king's approval – by the Warmian chapter. The latter was supported by the Teutonic Knights, by this point vassals of Poland, who were seeking a revision of the recently signed Second Peace of Toruń.
The Bishopric of Warmia was, in the 14th century, part of the Monastic State of the Teutonic Knights, but enjoyed autonomy and was administrated as a prince-bishopric. The bishops, often members of the Teutonic Order, were loyal to the order even in early 15th century, when the Teutonic Knights raised the taxes to pay for the resulting costs of Polish–Lithuanian–Teutonic War. Eventually, the order's policies and tax increases led to opposition within Prussia and to the foundation of the Prussian Confederation in 1440 by Prussian cities who wanted to defend their rights against the order.
The Prussian Confederation eventually asked for external aid and allied with the Polish king Casimir IV, asking to be incorporated into the Kingdom of Poland. This led to the Thirteen Years' War (1454–1466). The bishop of Warmia, Paul von Legendorf (1458–1467), joined the Prussian Confederation in the last year of the conflict (1466). The Second Peace of Thorn (1466) put Royal Prussia under the suzerainty of the Polish king. As part of the treaty, the king of Poland had the right to approve the bishop of Warmia, as chosen by the Warmian chapter.