General Lavr Kornilov, the army's commander-in-chief, attempted a coup to overthrow the Provisional Government and establish a military dictatorship. Kerensky, the prime minister, was forced to release imprisoned Bolsheviks and arm their militias to defend the city.