The Second Northern War (1655–60, also First or Little Northern War) was fought between Sweden and its adversaries the Polish–Lithuanian Commonwealth (1655–60), Russia (1656–58), Brandenburg-Prussia (1657–60), the Habsburg Monarchy (1657–60) and Denmark–Norway (1657–58 and 1658–60). The Dutch Republic often intervened against Sweden.
In 1655, Charles X Gustav of Sweden invaded and occupied western Poland–Lithuania, the eastern half of which was already occupied by Russia. The rapid Swedish advance became known in Poland as the Swedish Deluge. The Grand Duchy of Lithuania became a Swedish fief, the Polish–Lithuanian regular armies surrendered and the Polish king John II Casimir Vasa fled to the Habsburgs. Frederick William, Elector of Brandenburg and Duke of Prussia initially supported the estates in Royal Prussia, but allied with Sweden in return for receiving the Duchy of Prussia as a Swedish fief. Exploiting the hurt religious feelings of the Roman Catholic population under Protestant occupation and organizing Polish–Lithuanian military leaders in the Tyszowce Confederation, John II Casimir Vasa managed to regain ground in 1656. Russia took advantage of the Swedish setback, declared war on Sweden and pushed into Lithuania and Swedish Livonia.
Charles X Gustav then granted Frederick William full sovereignty in the Duchy of Prussia in return for military aid, and in the Treaty of Radnot allied himself with the Transylvanian George II Rákóczi who invaded Poland–Lithuania from the southeast. John II Vasa found an ally in Leopold I of Habsburg, whose armies crossed into Poland–Lithuania from the southwest. This triggered Frederick III of Denmark's invasion of the Swedish mainland in the spring of 1657, in an attempt to settle old scores from the Torstenson War while Sweden was busy elsewhere. Brandenburg left the alliance with Sweden when granted full sovereignty in the Duchy of Prussia by the Polish king in the treaties of Wehlau and Bromberg.