Hitler signed the Nonaggression Pact between Germany and the Soviet Union so that Germany would be able to invade Poland unopposed and not have to fight a two-front war.
The Pact was signed in 1939 and was supposed to last 10 years. However, it fell apart in 1941 when Nazis invaded the Soviet Union.