At the outbreak of World War II, which was sparked by the 1939 German invasion of Poland, Neville Chamberlain was the prime minister of the United Kingdom; he was succeeded by Winston Churchill in 1940, who remained prime minister until July 1945. Clement Attlee replaced Churchill as prime minister in July 1945 and, although the war was technically still ongoing at that point, Attlee is not considered to be a wartime prime minister. The United Kingdom had suspended elections during the war, and elections were not held again until Germany had surrendered.
At the end of Churchill's tenure as prime minister, Germany had surrendered, in May 1945, but Japan had not. Japan did not surrender until September 1945, and the United States took the majority of the responsibility for ensuring Japanese surrender. Churchill served as prime minister during the signing of the major treaties and the convening of major international conferences, although he was technically not prime minister at the very end of the war. With Europe relatively stable in the aftermath of the German and Italian surrender, the U.K. began to return to normal political life, which included the election of a new prime minister. Although Churchill was defeated by Attlee in 1945, he became prime minister again in 1951 and served until 1955.