The ESSR replaced the Republic of Estonia on 21 July 1940, after the invasion of Soviet troops on 17 June 1940. A puppet government backed by the Soviet Union, declared Estonia to be a Soviet state. The Estonian SSR was taken into the USSR on 9 August 1940. The independence of the Republic of Estonia was reestablished on 20 August 1991.