When in 1648 Poland elected John II Casimir as king, Opaliński joined the opposition. The king had few friends among the Polish nobility, as he openly sympathised with Austria and showed disregard and contempt for Sarmatism, which has become part of Polish culture. Due to this, thinking that John Casimir was too weak or for any other reasons, he encouraged King Charles X Gustav of Sweden to claim the Polish Crown. During the Swedish invasion (The Deluge) Krzysztof Opaliński and Bogusław Leszczyński were tasked with defence of the Greater Poland province. Dissatisfied with policies of John Casimir, they decided to surrender together with their pospolite ruszenie to Charles Gustav at Ujście on 25 July 1655. Many other voivodes of other voivodeships followed their suit, especially Prince Janusz Radziwiłł in the Grand Duchy of Lithuania (although Krzysztof's brother, Łukasz Opaliński, remained loyal to the Polish king). Almost the entire country was overrun by the Swedes, before the Jasna Góra resistance and the Tyszowce Confederation which turned the tide against the Swedes.