Kornilov attempted to attack Petrograd with loyal troops, to save the Provisional Government from being overthrown and to disperse Bolsheviks and Soviets. Kerensky publicly condemned Kornilov's actions and fearing a military right wing coup, placed Petrograd under martial law, freed and armed citizens and Bolsheviks. Kornilov surrendered when railway workers would not operate his trains.