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
Germany–Poland border at the Yalta Conference and Potsdam Conference. This border was a compensation to Poland for territories lost to the Soviet Union as a consequence of the Molotov–Ribbentrop Pact, and resulted in significant westward transfers of German population from the Recovered Territories, matching the Polish population transfers from the Kresy territories. It roughly matched the centuries-old, historical border between the Medieval Polish and German states. It divided several river cities into two parts – Görlitz/Zgorzelec, Guben/Gubin, Frankfurt (Oder)/Słubice, Bad Muskau/Łęknica. The border was recognized by East Germany in the Treaty of Zgorzelec in 1950, by West Germany in 1970 in the