or 1397, Švitrigaila and Fedor, son of Liubartas who was ousted from Volhynia near the conclusion of the Galicia–Volhynia Wars, escaped from Kraków to Duchy of Cieszyn, fief of the Kingdom of Bohemia, and from there to the court of Sigismund of Luxemburg. Švitrigaila contacted the Teutonic Knights, a long-standing enemy of Lithuania, and proposed an alliance against Vytautas. It was not an unprecedented move: Vytautas had done the same in 1382 and 1390 when he fought with Jogaila. However, the Knights concluded the Treaty of Salynas with Vytautas in October 1398 and Švitrigaila lost any hopes of an armed rebellion. He reconciled with Vytautas and received Navahrudak and a portion of Podolia not ruled by Spytek of Melsztyn. In 1399, Švitrigaila survived the disastrous Battle of the Vorskla River against the Golden Horde. Spytek of Melsztyn was killed in the battle and Švitrigaila received his lands in Podolia. Defection to Prussia In January 1401, Vytautas and Lithuanian nobles concluded the Pact of Vilnius which confirmed that after Vytautas' death Lithuania would be ruled by Jogaila and his heirs. That crushed Švitrigaila's ambition to one day become the Grand Duke of Lithuania. Chronicler Jan Długosz hinted that the Pact was in part motivated by the desire to contain growing influence and ambition of Švitrigaila. According to Johann von Posilge, Švitrigaila was forced to sign the Pact. However, just a month later he wrote to Siemowit IV of Masovia trying to form an alliance against Vytautas. Vytautas-instigated the First Samogitian Uprising against the Teutonic Knights started in March 1401. In August, Yury of Smolensk and his father-in-law Oleg II of Ryazan started a rebellion to retake the Principality of Smolensk. Švitrigaila decided to take advantage of these conflicts. In January 1402, instead of traveling to the wedding of Jogaila and Anna of Cilli, Švitrigaila, disguised as a merchant, traveled to Marienburg, the capital of the Teutonic Knights. On 2 March 1402, he concluded a treaty with the Knights which in essence confirmed the Treaty of Salynas. In July 1402, the Knights, including Švitrigaila, invaded Lithuania and marched towards Vilnius, the capital of Lithuania, however Vytautas learned of the planned treason and executed six city residents. The Knights did not dare to lay the siege and returned to Prussia. Vytautas wanted to concentrated on the rebellion in Smolensk and peace negotiations started in summer 1403. The truce was signed in December 1403