Early in the morning of August 24, 1939, the Soviet Union and Nazi Germany signed a 10-year non-aggression pact, called the Molotov–Ribbentrop pact. Most notably, the pact contained a secret protocol, revealed only after Germany's defeat in 1945, according to which the states of Northern and Eastern Europe were divided into German and Soviet "spheres of influence". In the North, Finland, Estonia and Latvia were assigned to the Soviet sphere. Poland was to be partitioned in the event of its "political rearrangement"—the areas east of the Narev, Vistula and San Rivers going to the Soviet Union while Germany would occupy the west. Initially annexed by Poland in a series of wars between 1918 and 1921 (primarily the Polish-Soviet War), these territories had mixed urban national populations with Poles and Ukrainians being the most numerous ethnic groups, with significant minorities of Belarusians and Jews. Much of this rural territory had its own significant local non-Polish majority (Ukrainians in the south and Belarusians in the north).
Lithuania, adjacent to East Prussia, would be in the German sphere of influence, although a second secret protocol agreed in September 1939 assigned the majority of Lithuania to the USSR. According to the secret protocol, Lithuania would retrieve its historical capital Vilnius, subjugated during the inter-war period by Poland.