Following a series of conflicts between Poland and Sweden in 1600–11, 1617–18 and 1621–1625, all of which ended in a stalemate, Gustavus Adolphus invaded in 1626 to gain control over Livonia and Ducal Prussia.
Sigismund, already in advanced age, continued his long-term ambition of reclaiming Sweden, which gave Gustavus Adolphus a reasonable casus belli and justification for war.
Though the Polish army achieved major victories in the previous battles against Sweden, particularly at Kircholm in 1605, the very end proved to be catastrophic.

The first skirmish took place in January 1626 near Wallhof, in present-day Latvia, where the Swedish army of 4,900 men ambushed a Polish force of 2,000 men commanded by Jan Stanisław Sapieha, son of Lew Sapieha.
Polish casualties were estimated at between 500 and 1000 dead, wounded and captured.
According to historians, the Polish-Lithuanian commander later suffered a nervous breakdown.

In May 1626 the Swedes launched an invasion of Polish Prussia.
Escorted by a fleet of 125 vessels, the Swedish army of over 8,000 soldiers (including 1,000 cavalry) disembarked in Ducal Prussia near the town of Piława (Pillau).
The landings were a complete surprise to the Commonwealth's defences, and despite a relatively small Swedish force, Gustavus Adolphus quickly captured 16 coastal towns, almost without a fight.
Many of these towns were inhabited by Protestants who opposed devoutly Catholic Sigismund.
Some towns opened their gates to the Lutheran Swedish forces whom they portrayed as liberators.
The Swedish king, however, failed to capture Danzig (Gdańsk), a large and wealthy port city which maintained its own army and fleet.
In preparation for his major attack on Danzig, he increased his forces to over 22,000 men.
Sigismund received little to no support from his vassal, George William, Elector of Brandenburg and Duke of Prussia.
Sigismund deployed an army of approximately 14,500 soldiers to fight at the Battle at Gniew against the Swedish force of 12,100 men.
The fighting continued for several days until 1 October 1626 when Sigismund ordered the withdrawal of his army, and called on reinforcements from around the country.
The battle, despite a tactical victory for Sweden, was a strategic blow to Gustavus Adolphus, who was unable to besiege Danzig, thus only securing the town of Gniew.

At Dirschau in summer 1627 Gustavus Adolphus was seriously wounded and the Prussian campaign was suspended.
The wound forced the king to stay in bed until autumn, and his right arm was weakened with some fingers partially paralyzed.
As the major trade ports on the coast of the Baltic Sea were blocked by Swedish vessels, Sigismund decided to send a fleet of 10 ships under Arend Dickmann from Danzig to engage the Swedes at the Battle of Oliva.
It was the largest naval battle fought by the Polish royal navy, which successfully defeated the enemy fleet and broke the Swedish blockade.

Although Poland emerged victorious in the final battle at Trzciana, Sigismund accepted a peace offer.
The Truce of Altmark was signed on 26 September 1629 (16 September O.S.).
The conditions of the truce allowed Sweden to gain control of Livonia as well as the mouth of the Vistula river and some coastal towns.
The greater part of Livonia north of the Daugava River was ceded to Sweden, though Latgale, the southeastern area and Dyneburg remained under Polish rule.
The Swedes received the right to the shipping tolls at ports of Polish–Lithuanian Commonwealth, which financed Sweden's involvement in the Thirty Years' War.

By the end of the 30-year Polish-Swedish conflict, Sigismund became heavily ill and was incessantly blamed for the loss of Livonia.
Following a series of conflicts between Poland and Sweden in 1600–11, 1617–18 and 1621–1625, all of which ended in a stalemate, Gustavus Adolphus invaded in 1626 to gain control over Livonia and Ducal Prussia. Sigismund, already in advanced age, continued his long-term ambition of reclaiming Sweden, which gave Gustavus Adolphus a reasonable casus belli and justification for war. Though the Polish army achieved major victories in the previous battles against Sweden, particularly at Kircholm in 1605, the very end proved to be catastrophic.
The first skirmish took place in January 1626 near Wallhof, in present-day Latvia, where the Swedish army of 4,900 men ambushed a Polish force of 2,000 men commanded by Jan Stanisław Sapieha, son of Lew Sapieha. Polish casualties were estimated at between 500 and 1000 dead, wounded and captured. According to historians, the Polish-Lithuanian commander later suffered a nervous breakdown.
In May 1626 the Swedes launched an invasion of Polish Prussia. Escorted by a fleet of 125 vessels, the Swedish army of over 8,000 soldiers (including 1,000 cavalry) disembarked in Ducal Prussia near the town of Piława (Pillau). The landings were a complete surprise to the Commonwealth's defences, and despite a relatively small Swedish force, Gustavus Adolphus quickly captured 16 coastal towns, almost without a fight. Many of these towns were inhabited by Protestants who opposed devoutly Catholic Sigismund. Some towns opened their gates to the Lutheran Swedish forces whom they portrayed as liberators. The Swedish king, however, failed to capture Danzig (Gdańsk), a large and wealthy port city which maintained its own army and fleet. In preparation for his major attack on Danzig, he increased his forces to over 22,000 men. Sigismund received little to no support from his vassal, George William, Elector of Brandenburg and Duke of Prussia. Sigismund deployed an army of approximately 14,500 soldiers to fight at the Battle at Gniew against the Swedish force of 12,100 men. The fighting continued for several days until 1 October 1626 when Sigismund ordered the withdrawal of his army, and called on reinforcements from around the country. The battle, despite a tactical victory for Sweden, was a strategic blow to Gustavus Adolphus, who was unable to besiege Danzig, thus only securing the town of Gniew.
At Dirschau in summer 1627 Gustavus Adolphus was seriously wounded and the Prussian campaign was suspended. The wound forced the king to stay in bed until autumn, and his right arm was weakened with some fingers partially paralyzed. As the major trade ports on the coast of the Baltic Sea were blocked by Swedish vessels, Sigismund decided to send a fleet of 10 ships under Arend Dickmann from Danzig to engage the Swedes at the Battle of Oliva. It was the largest naval battle fought by the Polish royal navy, which successfully defeated the enemy fleet and broke the Swedish blockade.
Although Poland emerged victorious in the final battle at Trzciana, Sigismund accepted a peace offer. The Truce of Altmark was signed on 26 September 1629 (16 September O.S.). The conditions of the truce allowed Sweden to gain control of Livonia as well as the mouth of the Vistula river and some coastal towns. The greater part of Livonia north of the Daugava River was ceded to Sweden, though Latgale, the southeastern area and Dyneburg remained under Polish rule. The Swedes received the right to the shipping tolls at ports of Polish–Lithuanian Commonwealth, which financed Sweden's involvement in the Thirty Years' War.
By the end of the 30-year Polish-Swedish conflict, Sigismund became heavily ill and was incessantly blamed for the loss of Livonia.
Sigismund III Vasa