The 17th century brought invading armies of Swedes, Hungarians, Turks, Russians and Cossacks to its gates. In 1648 an army of Cossacks and Crimean Tatars besieged the town. They captured the High Castle, murdering its defenders, but the city itself was not sacked due to the fact that the leader of the revolution Bohdan Khmelnytsky accepted a ransom of 250,000 ducats, and the Cossacks marched north-west towards Zamość. It was one of two major cities in Poland which was not captured during the so-called "Deluge": the other one was Gdańsk (Danzig). At that time, Lwów witnessed a historic scene, as here King John II Casimir made his famous Lwów Oath. On 1 April 1656, during a holy mass in Lwów's Cathedral, conducted by the papal legate Pietro Vidoni, John Casimir in a grandiose and elaborate ceremony entrusted the Commonwealth under the Blessed Virgin Mary's protection, whom he announced as "The Queen of the Polish Crown and other of his countries". He also swore to "protect the Kingdom's folk from any impositions and unjust bondage".