Query: The Latvian Soviet Socialist Republic was a republic of the Union of Soviet Socialist Republics.

Relevant passages:
Soviet Union <=SEP=> The Soviet Union ( -LSB- Сове́тский Сою́з , r = Sovetskiy Soyuz -RSB- -LSB- sɐ ` vʲetskʲɪj sɐˈjʉs -RSB- ) , officially the Union of Soviet Socialist Republics ( USSR ; Сою́з Сове́тских Социалисти́ческих Респу́блик , -LSB- sɐˈjus sɐˈvʲɛtskʲɪx sətsɨəlʲɪsˈtʲitɕɪskʲɪx rʲɪˈspublʲɪk -RSB- ) , also known unofficially as Russia ( -LSB- Росси́я , Rossiya , rɐˈsʲijə -RSB- ) , was a socialist state in Eurasia that existed from 1922 to 1991 . Nominally a union of multiple equal national Soviet republics , its government and economy were highly centralized in a state that was unitary in most respects . The country was a one-party federation , governed by the Communist Party with Moscow as its capital .   The Soviet Union had its roots in the October Revolution of 1917 , when the Bolsheviks , led by Vladimir Lenin , overthrew the Russian Provisional Government which had replaced Tsar Nicholas II . In 1922 , the Soviet Union was formed with the unification of the Russian , Transcaucasian , Ukrainian , and Byelorussian republics . Following Lenin 's death in 1924 and a brief power struggle , Joseph Stalin came to power in the mid-1920s . Stalin committed the state 's ideology to Marxism -- Leninism ( which he created ) , and initiated a centrally planned economy . As a result , the country underwent a period of rapid industrialization and collectivization . Political paranoia was also fomented around Stalin , and the Great Purge was carried out to remove his opponents from the Communist Party through arbitrary arrests and persecutions of many people .   Shortly before World War II , Stalin signed the Molotov -- Ribbentrop Pact agreeing to non-aggression with Nazi Germany , after which the two countries invaded Poland in September 1939 . In June 1941 , Germany invaded the Soviet Union , opening the largest and bloodiest theater of war in history . Soviet war casualties accounted for the highest proportion of the conflict in the effort of acquiring the upper hand over Axis forces at intense battles such as Stalingrad . The territories overtaken by the Red Army became satellite states of the USSR . The Cold War emerged by 1947 as the Eastern Bloc which united under the Warsaw Pact in 1955 confronted the Western states which united under NATO in 1949 .   Following Stalin 's death in 1953 , a period of political and economic liberalization , known as `` de-Stalinization '' and `` Khrushchev 's Thaw '' , occurred under the leadership of Nikita Khrushchev . The Soviet Union took an early lead in the Space Race , with the first artificial satellite and the first human spaceflight . In the 1970s , there was a brief détente of relations with the United States , but tensions resumed with the Soviet -- Afghan War in 1979 .   In the mid-1980s , the last Soviet leader , Mikhail Gorbachev , sought to reform and liberalize the economy through his policies of glasnost and perestroika . The Cold War ended during his tenure , and in 1989 , Soviet satellite states in Eastern Europe overthrew their respective communist governments . This led to the rise of strong nationalist and separatist movements inside the USSR as well . The government initiated a referendum , boycotted by some Soviet republics , which resulted in the majority of participating citizens voting in favor of preserving the union as a renewed federation . In August 1991 , an abortive coup d'état was attempted by Communist Party hardliners . The Russian President Boris Yeltsin played a high-profile role in facing down the coup . On 25 December 1991 , Gorbachev resigned and the remaining twelve constituent republics emerged from the dissolution of the Soviet Union as independent post-Soviet states . The Russian Federation -- formerly the Russian SFSR -- assumed the Soviet Union 's rights and obligations and is recognized as the primary legal successor of the Soviet Union .

Latvian Soviet Socialist Republic <=SEP=> The Latvian Soviet Socialist Republic ( Latvian SSR ; Latvijas Padomju Sociālistiskā Republika Латвийская Советская Социалистическая Республика , Latviyskaya Sovetskaya Sotsialisticheskaya Respublika ) , also known as Soviet Latvia or Latvia , was a republic of the Soviet Union .   It was established on 21 July 1940 , during World War II , as a Soviet puppet state in the territory of the previously independent Republic of Latvia after it had been occupied on June 17 , 1940 by the Soviet Army , in conformity with the terms of the 23 August 1939 Molotov -- Ribbentrop Pact .   Following the Welles Declaration of July 23 , 1940 , the annexation of Latvia into the Soviet Union ( USSR ) on 5 August 1940 was not recognized as legitimate by the United States , the European Community , and recognition of it as the nominal fifteenth constituent republic of the USSR was withheld for five decades . Its territory was subsequently conquered by Nazi Germany in June -- July 1941 , before being retaken by the Soviets in 1944 -- 1945 . Nevertheless , Latvia continued to exist as an de jure independent country with a number of countries continued to recognize Latvian diplomats and consuls who still functioned in the name of their former governments .   Soviet rule came to the end during the dissolution of the Soviet Union . The first freely elected parliament of the Latvian SSR passed a declaration `` On the Renewal of the Independence of the Republic of Latvia '' on May 4 , 1990 , restoring the official name of the State of Latvia as the Republic of Latvia . and restoring its former state symbols - flag and anthem . The full independence of the Republic of Latvia was restored on 21 August 1991 , during the 1991 Soviet coup d'état attempt and fully recognized by the Soviet Union on 6 September 1991 .