The Polish–Swedish War (1626–1629) was the last in a series fought by Sweden and the Polish–Lithuanian Commonwealth between 1600 and 1629. In July 1626, Gustavus Adolphus landed in Polish Prussia in an attempt to capture Gdańsk, but neither side could win a decisive advantage and the war became a stalemate.
Under the September 1629 Truce of Altmark, the Commonwealth accepted the loss of what became Swedish Livonia, including the strategic Baltic Sea port of Riga. Sweden also retained its gains in Prussia, although these were returned in the 1635 Treaty of Stuhmsdorf. The end of hostilities permitted Swedish intervention in the Thirty Years' War in June 1630.