a secret protocol of the molotov–ribbentrop pact signed on 23 august 1939 between nazi germany and the soviet union defined the spheres of influence, with estonia assigned to the soviet one. on 16 june 1940, the soviet union had invaded estonia. the military occupation was complete by 21 june 1940 and rendered "official" by a communist coup d'état.