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
History of Finland contributed to the early stages of the Livonian War which was a warlike era which lasted for 160 years. In the first phase, Sweden fought for the lordship of Estonia and Latvia against Denmark, Poland and Russia. The common people of Finland suffered because of drafts, high taxes, and abuse by military personnel. This resulted in the Cudgel War of 1596–1597, a desperate peasant rebellion, which was suppressed brutally and bloodily. A peace treaty (the Treaty of Teusina) with Russia in 1595 moved the border of Finland further to the east and north, very roughly where the modern border lies.