The Northern War of 1655–1660 was fought between Sweden and the Polish–Lithuanian Commonwealth, with participation at different times by Russia, Brandenburg-Prussia, the Habsburg monarchy, and Denmark–Norway. It ended with the treaties of Copenhagen and Oliva in 1660.

In 1655, Charles X took advantage of the Russo-Polish War (1654–67) to over-run western Poland. The Grand Duchy of Lithuania was annexed by Sweden, and John II Casimir Vasa took refuge in Vienna. He managed to regain parts of his kingdom in 1656, and the conflict widened when Russia declared war on Sweden, supported by Emperor Leopold and Frederick III of Denmark.

Previously allied with Sweden, Brandenburg switched sides in 1657 when Casimir granted Frederick William I sovereignty over the Duchy of Prussia. That winter, Charles X invaded Denmark and forced Frederick to withdraw from Southern Sweden. However, a second Swedish offensive failed, and by 1659 the war had become one of attrition, with neither side able to gain a decisive advantage.

After Charles died in February 1660, his son made peace with his opponents. Sweden kept most of its gains from Denmark, but the belligerents largely returned to the status quo ante bellum.

Background

The 1648 Peace of Westphalia that ended the Thirty Years' War confirmed Sweden as a major European power, and the replacement of its rival Denmark-Norway in the Baltic Sea. While Sweden and Russia had been at peace since the Treaty of Stolbovo in 1617, the former remained at war with the Polish–Lithuanian Commonwealth, although a truce between the two sides had been continually renewed since 1630.

thumb|left|upright|[[John II Casimir Vasa ]]

The Commonwealth had been increasingly weakened by internal rebellions, such as the Khmelnytsky Uprising, while conflict between King John II Casimir Vasa and the Sejm paralysed the administration. The Russo-Polish War (1654–67) began when Russian troops invaded Poland, supported by Cossack rebels. Meeting little opposition, these soon neared the Baltic coast, potentially threatening Swedish interests in the region.

This drove Charles X Gustav of Sweden to intervene, claiming to be protecting fellow Protestants in Poland. He sought support from the Cossack Hetmanate, promising military support if they abandoned the Russians. Although Sweden was anxious to avoid direct conflict with Russia, negotiations with Poland broke down when John II Casimir refused to drop claims to the Swedish crown. Combined with the unwillingness of the Polish–Lithuanian nobility to make concessions, talks in Lübeck ended in February 1655 without a result. Sweden now decided to launch a preemptive attack on the Commonwealth, seeking to occupy its yet available territories before the Russians.

Swedish campaigns in the Polish–Lithuanian Commonwealth

Swedish forces entered Poland–Lithuania from Swedish Pomerania in the west, and Livonia in the north. The division on the western flank consisted of 13,650 men and 72 artillery pieces commanded by Arvid Wittenberg who entered Poland on 21 July 1655 and another 12,700

On 24 August, Charles X Gustav joined Wittenberg's forces. The Polish king John II Casimir left Warsaw the same month to confront the Swedish army in the west, but after some skirmishes with the Swedish vanguard retreated southwards to Kraków.

On 20 October, a second treaty was ratified at Kėdainiai in the north. The Union of Kėdainiai unified Lithuania with Sweden, with Radziwiłł recognizing Charles X Gustav as Grand Duke of Lithuania.

In the north, the Royal Prussian nobles concluded a defensive alliance with the Electorate of Brandenburg on 12 November in the Treaty of Rinsk, permitting Brandenburgian garrisons. Danzig (Gdansk), Thorn (Torun) and Elbing (Elblag) had not participated in the treaty, with Thorn and Elbing surrendering to Sweden. In the Treaty of Königsberg on 17 January 1656, Frederick William, Elector of Brandenburg and Duke of Prussia, took the Duchy of Prussia, formerly a Polish fief, as a fief from Charles X Gustav. The Brandenburgian garrisons in Royal Prussia were withdrawn, and when Marienburg (Malbork) surrendered in March, Danzig remained the only town not under Swedish control.

Polish–Lithuanian recovery

The "deluge" In the same month, John II Casimir with the Lwów Oath proclaimed Virgin Mary queen of Poland, and promised to lift the burdens inflicted on the peasantry if he regained control. On 29 June however, Warsaw was stormed by John II Casimir, who had drawn up to Charles X Gustav with a force of 28,500 regulars and a noble levy of 18,000 to 20,000.

thumb|250px|Swedish King [[Charles X Gustav of Sweden|Charles X Gustav in skirmish with Polish Tatars during the Battle of Warsaw]]

In late July, Danzig was reinforced by a Dutch garrison, and a combined Danish and Dutch fleet broke the naval blockage imposed on Danzig by Charles X Gustav. On 28–30 July, a combined Brandenburgian-Swedish army was able to defeat the Polish–Lithuanian army in the Battle of Warsaw, forcing John II Casimir to retreat to Lublin. In August, Alexis' army took Livonian Kokenhausen (Koknese), laid siege to Riga and Dorpat (Tartu) and raided Estonia, Ingria and Kexholm.

On 4 October, John II Casimir stormed Łęczyca in Greater Poland before heading for Royal Prussia, and on 8 October, Wincenty Korwin Gosiewski with 12,000 to 13,000 Lithuanian and Crimean Tartar cavalry overran a Brandenburgian-Swedish force in the Battle of Prostken in Ducal Prussia. Gosiewski then ravaged Ducal Prussia, burning 13 towns and 250 villages, in a campaign that entered folklore because of the high death toll and the high number of captives deported to the Crimea. In the Treaty of Radnot on 6 December, Charles X Gustav promised to accept George II Rákóczi of Transylvania as king of Poland and Grand Duke of Lithuania in return for his entrance into the war.

Austro–Brandenburgian–Polish alliance, Danish campaigns in Sweden

thumb|300px|Territorial changes following the [[Treaty of Wehlau-Bromberg, compared to the pre-war situation (1654) and the treaties of Königsberg (January 1656) and Labiau (November 1656).]]

Like Sweden, John II Casimir also sought allies to break the deadlock of the war. On 1 December 1656, he signed an alliance with Ferdinand III of Habsburg in Vienna, essentially a declaration of Ferdinand III's intend to mediate a peace rather than provide military aid, which did not come into effect until Ferdinand's death on 2 April 1657. The treaty was however renewed and amended on 27 May by Ferdinand's successor Leopold I of Habsburg, who agreed in Vienna to provide John II Casimir with 12,000 troops maintained at Polish expense; in return, Leopold received Kraków and Posen in pawn. Receiving the news, Frederick III of Denmark promptly declared war on Sweden, and by June the Austrian army entered the Polish–Lithuanian Commonwealth from the south,

Meanwhile, Polish forces led by general Stefan Czarniecki ravaged southern Swedish Pomerania, and destroyed and plundered Pasewalk, Gartz (Oder) and Penkun. The Habsburg and Brandenburg allies however were reluctant to join Czarniecki, and against John II Casimir's wish decided against taking the war to the Holy Roman Empire fearing the start of a new Thirty Years' War. Denmark was forced to yield the provinces of Scania, Halland, Blekinge and the island of Bornholm. Halland had already been under Swedish control since the signing of the Treaty of Brömsebro in 1645, but they now became Swedish territory indefinitely. Denmark also had to surrender the Norwegian province Trøndelag to Sweden.

Yet, Swedish-held territory in Poland had been reduced to some towns in Royal Prussia, most notably Elbing, Marienburg and Thorn. With Transylvania neutralized and Brandenburg defected, Charles X Gustav's position in the region was not strong enough to force his stated aim, the permanent gain of Royal Prussia. He was further pressed militarily when an Austro-Polish army laid siege to Thorn in July 1658, and diplomatically when he was urged by France to settle.

thumb|250px|The [[Assault on Copenhagen (1659)|Assault on Copenhagen (1887) by Frederik Christian Lund.]]

When the Danes stalled and prolonged the fulfillment of some provisions of the Treaty of Roskilde by postponing payments and not blocking foreign fleets from access to the Baltic Sea, and with half of the 2,000 Danish soldiers that were obliged by Roskilde to enter Swedish service deserting, the Swedish king embarked from Kiel with a force of 10,000 men on 16 August. While everyone expected him to head for Royal Prussia, he disembarked on Zealand on 17 August, and headed for Copenhagen,

Meanwhile, the anti-Swedish alliance had deployed an army to Denmark, to confront Charles X Gustav with a force of 14,500 Brandenburgers commanded by Frederick William, 10,600 Austrians commanded by Raimondo Montecuccoli, and 4,500 Poles commanded by Czarniecki. By January 1659, the allied forces stood at Fredriksodde, Kolding and Als. Charles X Gustav then tried a decisive assault on Copenhagen on 21 and 22 February, but was repelled.

In Royal Prussia (Eastern Pomerania in contemporary Poland), Thorn had fallen already in December 1658, but Elbing and Marienwerder withstood. On 24 November, Sweden had to abandon Funen and Langeland after the defeat in the Battle of Nyborg. In January 1660, Sweden lost the Livonian fortress Mitau.

However, Denmark was not keen on peace after its recent successes and witnessing the weakness of the Swedish efforts. The Dutch Republic withdrew its blockade but was soon convinced by Denmark to support them again. France and England intervened for Sweden and the situation again teetered on the edge of a major conflict. However, the Danish statesman Hannibal Sehested negotiated a peace treaty without any direct involvement by foreign powers. The conflict was resolved with the Treaty of Copenhagen (1660). Sweden returned Bornholm and Trøndelag to Denmark.