The Soviet Union had its roots in 1917 when the Bolsheviks, headed by Vladimir Lenin, led the October Revolution which overthrew the provisional government that had replaced the Tsar. They established the Russian Socialist Federative Soviet Republic (renamed Russian Soviet Federative Socialist Republic in 1936), beginning a civil war between pro-revolution Reds and counter-revolution Whites. The Red Army entered several territories of the former Russian Empire and helped local Communists take power through soviets, which nominally acted on behalf of workers and peasants. In 1922, the Communists were victorious, forming the Soviet Union with the unification of the Russian, Transcaucasian, Ukrainian, and Byelorussian republics. Following Lenin's death in 1924, a troika and a brief power struggle, Joseph Stalin came to power in the mid-1920s. Stalin suppressed political opposition to him, committed the state ideology to Marxism–Leninism (which he created) and initiated a centrally planned economy. As a result, the country underwent a period of rapid industrialization and collectivization which laid the foundation for its victory in World War II and post-war dominance. Stalin also fomented political paranoia, and conducted the Great Purge to remove opponents of his from the Communist Party through the mass arbitrary arrest of many people (military leaders, Communist Party members, and ordinary citizens alike) who were then sent to correctional labour camps or sentenced to death.
In the beginning of World War II, Stalin signed a non-aggression pact with Hitler's Germany; the treaty delayed confrontation between the two countries. In June 1941 the Germans invaded, opening the largest and bloodiest theatre of war in history. Soviet war casualties accounted for the highest proportion of the conflict in the cost of acquiring the upper hand over Axis forces at intense battles such as Stalingrad. Soviet forces eventually captured Berlin in 1945. The territory overtaken by the Red Army became satellite states of the Eastern Bloc. The Cold War emerged in 1947 as the Soviet bloc formed the Warsaw Pact and confronted the Western states that united in the North Atlantic Treaty Organization in 1949. However the USSR did not itself engage in any so-called "hot wars."