Latvia states of Northern and Eastern Europe were divided into German and Soviet "spheres of influence". In the north, Latvia, Finland and Estonia were assigned to the Soviet sphere. A week later, on 1 September 1939, Germany and on 17 September, the Soviet Union invaded Poland. After the conclusion of the Molotov-Ribbentrop Pact, most of the Baltic Germans left Latvia by agreement between Ulmanis' government and Nazi Germany under the Heim ins Reich programme. In total 50,000 Baltic Germans left by the deadline of December 1939, with 1,600 remaining to conclude business and 13,000 choosing to remain in Latvia. Most of
Latvia–Russia border Latvia–Russia border Latvia–Russia border is the state border between Republic of Latvia (EU member) and the Russian Federation (CIS member). The length of the border is 214 km. The access-restricted Border Security Zone of Russia lies along the border on the Russian side. In order to visit this zone, a permit issued by the local FSB department is required (the only exceptions are international border transit points). The Pskov region and Latvia have had historical ties since the founding of the Pskov Republic in the 13th century. From 1925 to 1945 Abrene County was part of the Republic of Latvia.