He remained loyal to the Polish state during the war with Sweden (when many powerful magnates defected to the Swedish side). He recaptured the castle at Pilica from the Swedish commander Lindorn. He relieved his manor at Danków and forced the Swedes to retreat from Krzepice and Ogrodzieniec. He took part in the defence of Częstochowa, where Swedes laid siege to the Jasna Góra Monastery. Stanisław sent some of his men with provisions (cows) and 12 cannons to defend the monastery.