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
Finland–Russia border most of which were Savonians. After the Finnish War, the Treaty of Fredrikshamn converted all of Finland from Swedish territory to a Russian possession, the Grand Duchy of Finland. The Finnish–Russian border was moved back to the pre-1721 location, so that the Grand Duchy gained the so-called "Old Finland", territories previously held by Sweden, in 1812. After Finland became independent in 1917, there was the Finnish Civil War in 1918, and even after this war, the Russian Civil War continued. Finnish activists often crossed the border into Soviet territory in order to fight in the "heimosodat", wars aiming at Finnish