and the Peace of Raciąż in May 1404. The Knights received territorial concessions in Samogitia while Švitrigaila received Podolia (though the territory was de facto governed by Piotr Szafraniec), Zhydachiv, and an annual sum of 1,400 marks from the Wieliczka Salt Mine from Jogaila and the Principalities of Briansk, Chernigov, and Trubetsk from Vytautas. Defection to Moscow and imprisonment For a few years, Švitrigaila was loyal to Vytautas and helped to subdue Smolensk and negotiate with the Teutonic Knights regarding the Dobrzyń Land. Švitrigaila's new territories were by the border with the Grand Duchy of Moscow which began to emerge as the main rival to Lithuania. He decided to rebel against Vytautas once again but this time with the help of Vasily I of Moscow, who was also Vytautas' son-in-law. In May 1409, Švitrigaila with a great number of dukes and boyars defected to Moscow. Vasily I rewarded Švitrigaila with Vladimir, Volokolamsk, Pereslavl, Rzhev, half of Kolomna. Vytautas immediately gathered an army, including 5,000 Polish men commanded by Zbigniew of Brzezia and one flag of Teutonic Knights, and marched towards Russia. The two armies met on the Ugra River but did not engage in battle. The Lithuanian army was exhausted and lacked food while Russians needed to defend from an invasion of the Golden Horde, commanded by Edigu. A peace was concluded which treated Ugra River as the border between Russia and Lithuania. It is not known what happened to Švitrigaila after the standoff at the Ugra River. According to a contemporary Teutonic report, Vytautas demanded that as a condition for peace Vasily I would surrender Švitrigaila, but Vasily I claimed that he had escaped to the Golden Horde. The report further elaborated that Švitrigaila received marriage proposal to a daughter of a Tatar Emir. However, in June 1409, Švitrigaila was back at the court of Vytautas. Restless, he again attempted to conspire with the Teutonic Knights, but the letters were intercepted. Švitrigaila was arrested and imprisoned in various locations until he was settled in the Kremenets Castle, the only brick castle in Volhynia. There he had at least some freedom as he signed land donations. Escape to Hungary and reconciliation Švitrigaila remained imprisoned for nine years until his escape was organized by Dashko Feodorovich Ostrogski, Aleksander Nos, and Alexander of Smolensk. During the night of 24 March 1418 the conspirators, with 500 men, invaded the Kremenets Castle (the gate