Stalin was one of the seven members of the first Politburo, founded in 1917 in order to manage the Bolshevik Revolution, alongside Lenin, Zinoviev, Kamenev, Trotsky, Sokolnikov and Bubnov. Among the Bolshevik revolutionaries who took part in the Russian Revolution of 1917, Stalin was appointed General Secretary of the party's Central Committee in 1922. He subsequently managed to consolidate power following the 1924 death of Vladimir Lenin by suppressing Lenin's criticisms (in the postscript of his testament) and expanding the functions of his role, all the while eliminating any opposition. He remained general secretary until the post was abolished in 1952, concurrently serving as the Premier of the Soviet Union from 1941 onward.
Under Stalin's rule, the concept of "Socialism in One Country" became a central tenet of Soviet society, contrary to Leon Trotsky's view that socialism must be spread through continuous international revolutions. He replaced the New Economic Policy introduced by Lenin in the early 1920s with a highly centralised command economy, launching a period of industrialization and collectivization that resulted in the rapid transformation of the USSR from an agrarian society into an industrial power. However, the economic changes coincided with the imprisonment of millions of people in Gulag labour camps. The initial upheaval in agriculture disrupted food production and contributed to the catastrophic Soviet famine of 1932–33, known as the Holodomor in Ukraine. Between 1934 and 1939 he organized and led a massive purge (known as "Great Purge") of the party, government, armed forces and intelligentsia, in which millions of so-called "enemies of the working class" were imprisoned, exiled or executed, often without due process. Major figures in the Communist Party and government, and many Red Army high commanders, were killed after being convicted of treason in show trials.