Poland-Lithuania escapes the ravages of the Thirty Years' War, which ends in 1648, but the ensuing two decades subject the country to one of its severest trials.
This colorful but ruinous interval, the stuff of legend and the popular historical novels of Nobel laureate Henryk Sienkiewicz (1846-1916), become known as the potop, or deluge, for the magnitude of its hardships.
The emergency begins with an uprising of Ukrainian Cossacks that persists in spite of Warsaw's efforts to subdue it by force.
After the rebels win the intervention of Muscovy on their behalf, Tsar Alexis conquers most of the eastern half of the country by 1655.
Taking advantage of Poland's preoccupation, Charles X of Sweden rapidly overruns much of the remaining territory of the commonwealth in 1655.
Pushed to the brink of dissolution, Poland-Lithuania rallies to recover most of its losses to the Swedes.
Swedish brutality raises widespread revolts against Charles, whom the Polish nobles have recognized as their ruler in the meantime.
Under Stefan Czarniecki, the Poles and Lithuanians drive the Swedes from their territory by 1657.
Further complicated by noble dissension and wars with the Ottoman Turks, the thirteen-year struggle over control of Ukraine ends in the Truce of Andrusovo in 1667.
Although Russia had been defeated by a new Polish-Ukrainian alliance in 1662, Russia gains eastern Ukraine in the peace treaty.