In 1657, soon after his marriage with Countess Margarethe de Dietrichstein, he was ordered by the Emperor to take part in the Habsburg expedition (as agreed between the King of Poland and the Emperor) against Prince Rákóczy, Charles X Gustav of Sweden and the Cossacks, who had already, in 1655, attacked the Kingdom of Poland in the war known in Poland as "The Deluge" or elsewhere as the "Second Northern War". During the conflict he was promoted to commanding officer of the division.