 At the end of 1989 , two years before the final collapse of the Soviet Union , the Congress of People 's Deputies of the Soviet Union and Mikhail Gorbachev 's government formally denounced the Molotov – Ribbentrop Pact , acknowledging that the bloody annexation of the Baltic States and the partition of Poland had been illegal . 
