In 1479, an agreement reached between Casimir II and Matthias Corvinus further weakened Tüngen's position. Peace negotiations to end the conflict took place in Piotrków Trybunalski. The agreement reached on 15 July 1479 affirmed that Warmia was under the Polish king's sovereignty and required the bishops of Warmia to swear an oath of fealty to him. The Warmia chapter was also required to elect as bishop "a person to the liking of the king". As part of the agreement, Tüngen was allowed to remain Bishop of Warmia, after he paid homage to the king, entitling him to be a senator of Poland, like other Polish bishops.