In the course of Operation Barbarossa, Nazi Germany invaded Estonia in July–December 1941, and occupied the country until 1944. Estonia had gained independence in 1918 from the then-warring German and Russian Empires. However, in the wake of the August 1939 Nazi-Soviet Pact, the Soviet Union had invaded and occupied Estonia in June 1940, and the country was formally annexed into the USSR in August 1940.
In the summer of 1941, the German invaders were at first seen by most Estonians as liberators from Soviet terror, since the Germans arrived only a week after the mass deportation of tens of thousands of people from Estonia and other territories occupied by the USSR in 1939–1941: eastern Poland, Latvia, Lithuania, Bessarabia and Northern Bukovina. Despite high hopes for Estonian independence, the people there soon realized that the Germans were just a different occupying power.