in preparation for the crusade against the golden horde in 1398, vytautas had signed the treaty of salynas with the teutonic knights and transferred žemaitija samogitia to them. žemaitija/samogitia was especially important for the order because it separated the teutonic knights, based in prussia, from the livonian order, based in latvia. the two orders desired to unite and form a mighty force. however, the knights ruled žemaitija for only three years, because on march 13, 1401, the samogitians, supported by vytautas, rebelled and burned two castles. the knights received support from švitrigaila, brother of jogaila, who desired to take vytautas' title. in 1404 peace of raciąż was signed, which in essence repeated the treaty of salynas: žemaitija/samogitia was transferred to the teutonic knights. poland promised not to support lithuania in case of another war. the knights promised to support vytautas in the east and not to support any gediminid who could have claims to the title of grand duke of lithuania. however, the treaty did not solve the problems, and all the parties prepared for war.