Yet this great victory was virtually fruitless, owing to the domestic dissensions; the Sejm (Commonwealth parliament) failed to agree on raising the funds needed for the war effort. Chodkiewicz was one of the magnates who remained loyal to king Sigismund III, and helped him to defeat the Sandomierz rebellion (rokosz of Zebrzydowski) in 1606–1607. He commanded the right wing of the royal army during the Battle of Guzów on 6–7 July 1607, in which the insurgents were defeated, and then quelled the unrest in the Grand Duchy of Lithuania, fighting against another rebellious magnate, Janusz Radziwiłł, until Radziwiłł negotiated a settlement with the king in 1608. A fresh invasion of Livonia by the Swedes recalled him thither once more, and in 1609 he relieved Riga and recaptured Pernau. He improvised a small fleet and dealt a surprise blow to the Swedish Navy at the Battle of Salis.