As a result of Polish–Soviet War, Poland secured a 105 km long border with Latvia. In July 1919 Poland announced annexation of all lands south of Daugavpils and their inclusion in Braslaw district. Latvia could not complain, as it still needed Polish military help for the decisive Battle of Daugavpils against the Soviets. The issue was solved by renewed Soviet attack against Poland, and later, by Polish-Lithuanian conflict over Vilnius. During the Soviet attack in July 1920, Polish forces retreated from this area which then was occupied by Latvian forces. After Żeligowski's Mutiny Poland wanted to have good diplomatic relations with Latvia and did not raise any serious territorial claims. The issue was solved in February 1929, when Latvian-Polish trade treaty was signed, which included a secret agreement about compensations to Polish landowners over lost properties. By 1937 Latvia had paid the full amount of 5 million golden lats. Over some protests from Lithuania, Latvian-Polish border was demarcated between 1933 and 1938.