The First Peace of Thorn of 1411 had ostensibly ended conflicts between the warring powers of the Polish-Lithuanian–Teutonic War, although the border between Samogita and Prussia was not determined. Poland also contested Pomerania, Pomerelia, and Culmerland. When numerous attempts at negotiations failed, a brief Hunger War broke out in summer 1414. Since Poles and Lithuanians were unable to capture strongly fortified Ordensburgen of the Knights, parties agreed to mediate their dispute in the Council of Constance. The Council established the Samogitian Diocese in Varniai and appointed Matthias of Trakai as its first bishop. However, it did not solve the underlying territorial disputes by the time it ended in 1418. A new, but futile, round of negotiations started in May 1419 in Gniewków with papal legate Bartholomew Capri, archbishop of Milan, as mediator. The dispute was then passed to Sigismund, Holy Roman Emperor, for further mediation. On January 6, 1420 in Wrocław the emperor delivered his decision that the Peace of Thorn was valid and fair. That meant that Samogitia belonged to Lithuania only for the lifetime of Vytautas the Great, Grand Duke of Lithuania, and Jogaila, King of Poland. After their deaths Samogitia was to return to the Teutonic Knights. Other territorial claims were also rejected. The emperor granted the Knights even more rights than they demanded in negotiations. This decision was probably influenced by the fact that Sigismund hoped to receive support from the Teutonic Knights in his war with the Hussites, who were supported by Vytautas. Vytautas and Jogaila categorically refused to accept this decision. Jogaila unsuccessfully appealed to Pope Martin V.
The war
In July 1422, the Emperor Sigismund and the Teutonic Knights devoted resources to a war against the Hussites, who attacked and devastated large parts of Germany. The pope called for strong measure to 'get rid of this plague'. Vytautas and Jogaila used the preoccupation with defense against the Hussite raids by attacking Prussia and the Order. Teutonic Grand MasterMichael Küchmeister von Sternberg was forced to resign in March. His successor Paul von Rusdorf released most of the hired mercenaries; the Order was left with very few soldiers to defend itself. Joint Polish and Lithuanian forces marched north to Osterode, Teutonic forces retreated to Löbau. When it became clear that siege engines would not arrive, Jogaila ordered an advance towards the Order's fortified capital of Marienburg. His army captured Riesenburg and pillaged surrounding villages. Heading south to Chełmno Land, the Poles and Lithuanians then captured Gollub, but failed to take Schönsee. Jogaila decided to end the war quickly before the overwhelmed Prussian troops of the Order could receive reinforcements from the Holy Roman Empire that Paul von Rusdorf had requested. A truce was signed on September 17, 1422, and the war concluded ten days later with the Treaty of Melno. This ended the territorial disputes and fights between Lithuania and the Teutonic Knights. Poland, however, resumed fighting with the Order once again in 1431–1435 when the Order supported Švitrigaila and not Polish-backed Sigismund Kęstutaitis as the successor of Vytautas.