The Nazi-Soviet Pact allowed Hitler and Stalin to invade and divide Poland between German and Soviet forces in 1939. Both leaders were wary of a potential two-front war and saw an opportunity to conquer territory. Hitler wanted to avoid a Russian attack from the east during an invasion of Poland, while Stalin sought time to rearm in case of a future German attack and gain eastern Polish lands as a buffer zone. The invasion succeeded in dividing Poland, but Britain and France declared war on Germany as they had pledged to defend Poland.