Disputes between Sweden and Poland over the Baltic region, and in particular the claim of the Polish King John II Casimir Vasa to the Swedish throne, culminated in 1655 in a military exhibition by the Swedish King Charles X Gustav into Poland. Dissatisfaction with the policies of John Casimir had divided the Polish public into two camps even prior to the Swedish invasion; the anti-monarchical opposition included not only non-Catholics, who saw in the Swedish sovereign a natural ally and protector against the pressures of re-Catholicisation, but also some of the Polish Catholic nobility.
Initially Charles Gustav was able to take almost the whole country virtually without a fight. The cruel progress of the Swedes awoke resistance among the masses, further encouraged by effective Catholic propaganda. In the general uprising against the Swedes, Polish rebels fell upon Leszno in April 1656. For the town and for Comenius personally the attack ended in tragedy – the town was taken and razed.
Comenius managed to escape from the town and across the border into Silesia, where he found refuge with Lord Václav Theodor of Budov. He never returned to Poland. In his flight he had managed to save only some of his manuscripts, and lost all his other belongings, above all the remaining manuscripts and his library. The First Northern War came to an end in 1660 with the signing of a peace treaty at Oliva. The Polish King John II Casimir renounced all claims to the Swedish throne, the Swedes remained in possession of Livonia and gained Skane from Denmark, and the independence of Prussia was confirmed.