In Vladimir Lenin's government in the Russian Revolution, Leon Trotsky first played the role of Commissar for Foreign Affairs and then the leader of the Red Army. In the Bolshevik government, he was second only to Lenin and seemed destined to succeed him until Joseph Stalin outmaneuvered him politically and banished him from the Soviet Union.
In February 1917, after Czar Nicholas II was overthrown, Trotsky set out for Russia from New York, where he had been living in exile. After arriving in Russia, he was arrested by Alexander Kerensky, the new prime minister. He joined the Bolshevik Party while in jail, and soon after his release he became chairman of the Petrograd Soviet. When the provisional government was overthrown and Lenin assumed power, as Commissar for Foreign Affairs, Trotsky was tasked with negotiating a peace accord with the Germans so that the Russians could exit World War I and focus on building their government.
As the Commissar of Army and Navy affairs, Trotsky built up the Red Army from less than 300,000 to 3,000,000 and successfully led the army to victory during the Russian Civil War. This was complicated, because there were sometimes as many as 16 different fronts. The struggle with Stalin began as a dispute between Trotsky and Lenin over the role of unions. Stalin seized the opportunity to gain Lenin's favor and push Trotsky out of power.