Stalin signed the Nazi-Soviet Pact on August 23rd, 1939, believing it would buy him time to prepare for war, even though he knew Hitler planned to eventually attack the USSR
The day after signing the Nazi-Soviet Pact, Stalin explained to Lavrenti Beria that he knew Hitler's intentions and believed he had tricked Hitler into thinking he was outsmarted