

In August 1939, Hitler's Germany and Stalin's Soviet Union concluded a pact of non-aggression. According to a confidential supplementary protocol, Finland was considered to be within the sphere of interest of the Soviet Union. During the course of that same autumn, the Soviet Union put forward territorial demands to secure Leningrad (presently Saint Petersburg), but negotiations failed.
On 30 November 1939, the Soviet Union attacked Finland in what was intended to be a quick invasion of the country. That is when the Winter War began. Finland's field army was poorly equipped and undermanned in comparison with the Red Army, but it was well trained. It was able to repel the Soviet Army's attacks in Ladoga, Karelia, and in northern Finland.
In February 1940, the Soviet Union launched an offence that broke Finland's main line of defence on the Karelia Isthmus and led to Finnish withdrawal. The Soviet Union's fear of French and British involvement in the war made it agree to sign a peace treaty in Moscow on 13 March 1940. As a result of the war, Finland lost the Karelian Isthmus, parts of Salla and Petsamo, and was forced to lease the Hanko peninsula to the Soviet Union.
The Moscow Peace Treaty did not mean things calmed down between Finland and the Soviet Union. It was feared the Soviet Union would strike again. During this time of uncertainty, Finland found itself an ally, Germany. Finland believed this would keep the Soviet Union at bay and that it could maybe get compensation for the losses imposed on it by the Moscow Peace Treaty.
The territorial losses and the leasing of the Hanko peninsula had weakened Finland's chances of defending itself. Finland began fortifying its eastern border in 1940. The fortification, referred to as the Salpa Line, extended from Lapland to the Gulf of Finland.
From early summer 1941, Finland began preparing for war alongside Germany. The "interim peace" ended in June 1941 when Germany attacked the Soviet Union with Finland fighting by its side.
