The six-year Truce of Altmark (or Treaty of Stary Targ) was signed on September 25, 1629 at the Altmark (Stary Targ), near Danzig (Gdańsk) by Sweden and the Polish-Lithuanian Commonwealth during the Thirty Years' War, ending the Polish–Swedish War (1626–1629).
The conditions of the truce allowed Sweden to retain control of Livonia and the mouth of the Vistula river. Sweden also evacuated most of the Duchy of Prussia, but kept the coastal cities. The Polish-Lithuanian Commonwealth got back other Swedish gains since the 1625 invasion. The greater part of Livonia north of the Western Dvina (Vidzeme) was ceded to Sweden, though Latgale, the southeastern area, remained under Commonwealth rule. Sweden received the right to 2/3 of all the shipping tolls at ports of the Polish-Lithuanian Commonwealth, such as Danzig and Elbląg (Elbing) and from the Duchy of Prussia's ports for the next six years. These shipping tolls financed Sweden's involvement in the Thirty Years' War.
The Truce of Altmark was signed shortly after Sweden was defeated by Commonwealth and Holy Roman Imperial troops at Trzciana (Honigfelde) also known as Sztum (Stuhm), at which King Gustavus Adolphus of Sweden narrowly escaped capture. Gustavus was wounded several times and at one point was saved by one of his men - Eric Soop.
The Polish parliament (Sejm) did not impose new taxes in order to pay the soldiers of the imperial army fighting under Hans Georg von Arnim-Boitzenburg, and due to low morale some of them mutinied or went over to the Swedish side. Several other countries intervened diplomatically and Sigismund III was eventually forced to enter the truce.
In 1635, the truce was extended via the Treaty of Stuhmsdorf. Sweden gave up the Prussian ports and the Polish-Lithuanian Commonwealth ceded most of Livonia with Riga, keeping the Daugavpils area.