The (First) Peace of Thorn was a peace treaty formally ending the Polish–Lithuanian–Teutonic War between allied Kingdom of Poland and Grand Duchy of Lithuania on one side, and the Teutonic Knights on the other. It was signed on 1 February 1411 in Thorn (Toruń), one of the southernmost cities of the Monastic State of the Teutonic Knights. In historiography, the treaty is often portrayed as a diplomatic failure of Poland–Lithuania as they failed to capitalize on the decisive defeat of the Knights in the Battle of Grunwald in June 1410. The Knights returned Dobrzyń Land which they captured from Poland during the war and made only temporary territorial concessions in Samogitia, which returned to Lithuania only for the lifetimes of Polish King Władysław Jagiełło and Lithuanian Grand Duke Vytautas. The Peace of Thorn was not stable. It took two other brief wars, the Hunger War in 1414 and Gollub War in 1422, to sign the Treaty of Melno that solved the territorial disputes. However, large war reparations were a significant financial burden on the Knights, causing internal unrest and economic decline. The Teutonic Knights never recovered their former might.
In May 1409, an uprising started in Samogitia, which had been in Teutonic hands since the Peace of Raciąż of 1404. Grand Duke of Lithuania Vytautas supported the uprising. Poland, which had been in a personal union with Lithuania since 1386, also announced its support to the Samogitian cause. Thus the local uprising escalated into a regional war. The Teutonic Knights first invaded Poland, catching the Poles by surprise and capturing the Dobrzyń Land without much resistance. However, neither side was ready for a full-scale war and agreed to a truce mediated by Wenceslaus, King of the Romans in October 1409. When the truce expired in June 1410, allied Poland–Lithuania invaded Prussia and met the Teutonic Knights in the Battle of Grunwald. The Knights were soundly defeated, with most of their leadership killed. Following the battle, most Teutonic fortresses surrendered without resistance and the Knights were left with only eight strongholds. However, the allies delayed their Siege of Marienburg, giving the Knights enough time to organize defense. The Polish–Lithuanian army, suffering from lack of ammunition and low morale, failed to capture the Teutonic capital and returned home in September. The Knights quickly recaptured their fortresses that were taken by the Poles. Polish King Jogaila raised a fresh army and dealt another defeat to the Knights in the Battle of Koronowo in October 1410. Heinrich von Plauen, new Teutonic Grand Master, wanted to continue fighting and attempted to recruit new crusaders. However, the Teutonic Council preferred peace and both sides agreed to a truce, effective between 10 December 1410 and 11 January 1411. Three-day negotiations in Raciąż between Jogaila and von Plauen broke down and Teutonic Knights invaded Dobrzyń Land again. The incursion resulted in a new round of negotiations that ended with the Peace of Thorn.