From the early days, the reign of Jan Kazimierz was plagued by wars that beset the Polish-Lithuanian Commonwealth, starting with a Cossack revolt supported by Tatar forces in 1648, through wars with Muscovy (1654-1667), Sweden (1655-1660), Brandenburg (1656-1657) and Transylvania (1657), to fighting the Cossacks and Tatars in 1667.
The Swedish invasion of 1655 proved a truly catastrophic event. Faced with the capture of most of the Grand Duchy of Lithuania and Ukraine by Russia and its Cossack allies, a significant number of the magnates and nobles in conflict with Jan Kazimierz surrendered to the Swedes almost without a fight. Jan Kazimierz had to flee the country. Yet the severe pillaging visited upon the land by Swedish soldiers and the German mercenaries in their ranks, coupled with their religious otherness (they were Lutherans), quickly sparked resistance from the plebeian masses and the nobility alike. The successful defence of the Jasna Góra monastery, home to a venerated painting of the Madonna (the painting was in Habsburg Silesia during the siege), at the end of 1655 marked a turning point in the war.
The royal court used this event for propaganda purposes when Jan Kazimierz returned to Poland in 1655/1656. Lwów (Leopolis), where the Swedes had not penetrated, became the command centre of resistance against the invaders. It was there, in the city cathedral, on 1 April 1656, that Jan Kazimierz made a solemn vow before the altar of Our Lady of Graces, establishing the Holy Mother as Queen of the Polish Crown and promising remissions for the peasants. By doing so, the ruler sanctioned the religious nature of the conflict with Sweden and made concessions to the commoners, exploiting their zeal in the fight against the enemy. The ceremonial mass at the Lwów Cathedral was celebrated by the papal nuncio, Pietro Vidoni, with numerous dignitaries waiting on the king in attendance. Although the social programme enounced in the Lwów vows was never put into action, they have come down in Polish history as an important symbol of national awakening and unity in the face of external danger.