
The Latvian Soviet Socialist Republic (SSR) was a republic of the Soviet Union that existed from 1940 to 1990, with its capital at Riga. The Latvian SSR was established after the Soviets annexed the Baltics in 1940 as a part of their agreement with Nazi Germany under the Molotov-Ribbentrop Pact, but the United States and most European countries did not recognize the USSR's annexation of the Baltics until 1990. On 4 May 1990, the parliament of the Latvian SSR restored the Latvian flag and national anthem and declared independence from the USSR, and the Latvian SSR was formally dissolved on 21 August 1991 when the coup against Mikhail Gorbachev by pro-unionist CPSU hardliners failed and rendered the reunification of the USSR impossible.