In May 1409, an uprising in Teutonic-held Samogitia started. Lithuania supported the uprising and the Knights threatened to invade. Poland announced its support for the Lithuanian cause and threatened to invade Prussia in return. As Prussian troops evacuated Samogitia, the Teutonic Grand Master Ulrich von Jungingen declared war on the Kingdom of Poland and Grand Duchy of Lithuania on 6 August 1409. The Knights hoped to defeat Poland and Lithuania separately and began by invading Greater Poland and Kuyavia, catching the Poles by surprise. The Knights burned the castle at Dobrin , captured Bobrowniki after a fourteen-day siege, conquered Bydgoszcz , and sacked several towns. The Poles organized counterattacks and recaptured Bydgoszcz. The Samogitians attacked Memel . However, neither side was ready for a full-scale war. Wenceslaus, King of the Romans, agreed to mediate the dispute. A truce was signed on 8 October 1409; it was set to expire on 24 June 1410. Both sides used this time for preparations for the battle, gathering the troops and engaging in diplomatic maneuvers. Both sides sent letters and envoys accusing each other of various wrongdoings and threats to Christendom. Wenceslaus, who received a gift of 60,000 florins from the Knights, declared that Samogitia rightfully belonged to the Knights and only Dobrzyń Land should be returned to Poland. The Knights also paid 300,000 ducats to Sigismund of Hungary, who had ambitions for the principality of Moldova, for his military assistance. Sigismund attempted to break the Polish-Lithuanian alliance by offering Vytautas a king's crown; Vytautas's acceptance of such a crown would violate the terms of the Ostrów Agreement and create Polish-Lithuanian discord. At the same time Vytautas managed to obtain a truce from the Livonian Order.. Which countries were invaded first?