With Poland engaged in a war with Russia to maintain control of the Ukraine, Charles X King of Sweden invaded Poland. He occupied Warsaw on October 8, 1655 and Krakow on October 19, 1655. Prussia first sided with Sweden then switched sides the next year.