On August 23, 1939–shortly before World War II (1939-45) broke out in Europe–enemies Nazi Germany and the Soviet Union surprised the world by signing the German-Soviet Nonaggression Pact, in which the two countries agreed to take no military action against each other for the next 10 years. With Europe on the brink of another major war, Soviet leader Joseph Stalin (1879-1953) viewed the pact as a way to keep his nation on peaceful terms with Germany, while giving him time to build up the Soviet military. German chancellor Adolf Hitler (1889-1945) used the pact to make sure Germany was able to invade Poland unopposed. The pact also contained a secret agreement in which the Soviets and Germans agreed how they would later divide up Eastern Europe. The German-Soviet Nonaggression Pact fell apart in June 1941, when Nazi forces invaded the Soviet Union.