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 relations time, often replacing those who were deported. The high influx of Russians and the removal of Latvian as the official language caused further deteriorations in the Latvia-Russian relations between citizens. In 1991, Latvia regained independence from the USSR through the Latvian independence and democracy poll, 1991. On April 2004 Latvia expelled Second Secretary of the Russian Embassy in Rīga Pyotr Uzhumov, who had allegedly trying to gather information on Latvia's defence forces, for activities "incompatible with his diplomatic status" to which Russia responded by expelling first secretary of the Latvian Embassy in Moscow. In 2007, the border treaty between the