Peace of Raciąż
Peace of Raciąż was a treaty signed on 22 May 1404 between Kingdom of Poland, Grand Duchy of Lithuania, and the Teutonic Knights, regarding the control of the Dobrzyń Land and Samogitia. Poland in essence confirmed the Treaty of Kalisz of 1342 and Lithuania – the Treaty of Salynas of 1398. The treaty was not stable and the situation soon changed with the Polish-Lithuanian–Teutonic War of 1409–1411.
Poland, with support of the papacy, was able to increase its ties with the Grand Duchy, by signing the Union of Vilnius and Radom in 1401. The same year Samogitians rebelled against the Knights. The rebels burnt several Teutonic castles. The Knights retaliated by raiding Kaunas and Hrodna. In 1402 the Order allied with Lithuanian duke Švitrigaila, brother of Jogaila, who promised to follow the Treaty of Salynas and cede Samogitia to the Knights.
When neither side could achieve decisive victory and Vytautas the Great wanted to direct his attention to a war against Yury of Smolensk, the negotiations started in summer 1403. The final treaty was signed in Raciąż and addressed some of the territories disputed between Poland, Lithuania and the Order: the Dobrzyń Land was to return to Poland for a fee, Samogitia was to remain with the Order, and the discussion regarding the Gdańsk (Danzig) region was inconclusive. Švitrigaila was allowed to return to Podolia.
When in 1408 Vytautas concluded his wars in the east with the Grand Duchy of Moscow, he was able to concentrate on the Teutonic Knights again. Samogitians rebelled for the second time in 1409. That led to a new war between Poland–Lithuania and the Knights, who were decisively defeated in the Battle of Grunwald in 1410. The Peace of Thorn (1411) changed borders determined by the Peace of Raciąż.