After the October Revolution of 1917, Stalin, already a member of the central committee since 1912, entered the Soviet cabinet as people's commissar for nationalities and began to emerge as a leader of the new regime. During the civil war from 1918 to 1920 he played an important administrative role on the military fronts and in the capital. He was elected (1922) general secretary of the central committee of the party, enabling him to control the rank-and-file members and to build an apparatus loyal to him.
Stalin's significance in the revolutionary movement and his relation to Lenin have been subjects of great controversy. He was highly regarded by Lenin as an administrator but not as a theoretician or leader. Toward the end of his illness, which began in 1922, Lenin wrote a testament in which he strongly criticized Stalin's arbitrary conduct as general secretary and recommended that he be removed. However, he died before any action could be taken, and the testament was suppressed.
On Lenin's death, Stalin, Kamenev, and Grigori Zinoviev formed a triumvirate of successors allied against Trotsky, who was a strong contender to replace Lenin. After Trotsky was ousted (1925) as commissar of war, Stalin, now allied with Nikolai Bukharin, turned on Kamenev and Zinoviev. In a desperate attempt to counter Stalin's power, Zinoviev and Kamenev joined forces with Trotsky. Their efforts failed and they were forced to resign from the central committee of the Communist party. Stalin subsequently broke with Bukharin and engineered his fall from power.
A primary issue around which these party struggles centered was the course of the Russian economy. The right wing, led by Bukharin, favored granting concessions to the peasantry and continuing Lenin's New Economic Policy (NEP). The left, represented by Kamenev and Zinoviev, wished to proceed with industrialization on a large scale at the expense of the peasants. Stalin's position wavered, depending on the political situation, and the NEP continued until 1928 with considerable success. Then Stalin reversed this policy and inaugurated collectivization of agriculture and the Five-Year Plan. Ruthless measures were taken against the kulaks, the farmers who had risen to prosperity under the NEP.