When World War I began in 1914, Russia was at war with Germany. The Russian army comprised a large working-class contingent of laborers and peasants for whom service was compulsory. The Russian army sustained heavy losses as a result of participation in the war. In February of 1917, a group of workers went on strike and rioted. Russian soldiers were ordered to fire on this group and refused, rebelling against Tsar Nicolas II, who was ousted and replaced by two factions of provisional governments, the Petrograd Soviet government and the Provisional Government. The former was socialist, and the latter was more traditional. These two sides ruled at the same time for several months, and the Bolsheviks, a group from the Petrograd Soviet group in favor of Marxist politics, took control under Vladimir Lenin. After the success of the Bolshevik Revolution, Russia signed a treaty with Germany, thus exiting World War I.