 In 1939, it signed a non-aggression pact with Nazi Germany, resulting in the Soviet invasion of Poland.Germany ended the pact by invading the Soviet Union in 1941.Despite initial setbacks, the Soviet Red Army repelled the German incursion and captured Berlin in 1945, ending World War II in Europe.