On 23 August 1939, Nazi Germany and the Soviet Union signed the Molotov–Ribbentrop Pact, which contained agreements to divide Europe into spheres of influence, with Lithuania falling into Germany's sphere of influence. On 28 September 1939, the USSR and Germany signed the Frontier Treaty and its secret protocol, by which Lithuania was placed in the USSR's sphere of influence in exchange for Germany gaining an increased share of Polish territory, which had already been occupied. The next day, the USSR offered Lithuania an agreement on the establishment of Soviet military bases in its territory. During the negotiations, the Lithuanian delegation was told of the division of the spheres of influence. The Soviets threatened that if Lithuania refused to host the bases, Vilnius could be annexed to Belarus. In these circumstances a Lithuania–USSR agreement on mutual assistance was signed in Moscow on 10 October 1939, allowing a Soviet military presence in Lithuania. A total of 18,786 Red Army troops were deployed at strategically important locations within the country: Alytus, Prienai, Gaižiūnai, and Naujoji Vilnia. This move effectively ended Lithuanian neutrality and brought it directly under Soviet influence.