In 1632 he returned to Poland. As part of Poland's royal army he fought in the Smolensk War (1633–1634), The Deluge, Russo-Polish War (1654–67) and the Chmielnicki Uprising. During the Deluge - the Swedish invasion of Poland - unlike many commanders in the north of Poland, he did not switch sides and defect to the Swedes. Instead he defended Malbork for two months before capitulating. He was able to obtain from the Swedes a safe passage of his troops which retained their arms; he would soon join the Polish king in the south and would continue to fight the invaders.