The February Revolution (March 1917) was a revolution focused around Petrograd (now Saint Petersburg). In the chaos, members of the Imperial parliament or Duma assumed control of the country, forming the Russian Provisional Government. The army leadership felt they did not have the means to suppress the revolution, resulting in Nicholas' abdication. The Soviets (workers' councils), which were led by more radical socialist factions, initially permitted the Provisional Government to rule, but insisted on a prerogative to influence the government and control various militias. The February Revolution took place in the context of heavy military setbacks during the First World War (1914–18), which left much of the Russian army in a state of mutiny.
A period of dual power ensued, during which the Provisional Government held state power while the national network of Soviets, led by socialists, had the allegiance of the lower classes and the political left. During this chaotic period there were frequent mutinies, protests and many strikes. When the Provisional Government chose to continue fighting the war with Germany, the Bolsheviks and other socialist factions campaigned for stopping the conflict. The Bolsheviks turned workers militias under their control into the Red Guards (later the Red Army) over which they exerted substantial control.
In the October Revolution (November in the Gregorian calendar), the Bolshevik party, led by Vladimir Lenin, and the workers' Soviets, overthrew the Provisional Government in Petrograd and established the Russian SFSR, eventually shifting the capital to Moscow in 1918. The Bolsheviks appointed themselves as leaders of various government ministries and seized control of the countryside, establishing the Cheka to quash dissent. To end Russia’s participation in the First World War, the Bolshevik leaders signed the Treaty of Brest-Litovsk with Germany in March 1918.