General Kornilov, head of the Armed Forces in the South West, ordered a large number of troops to march on Petrograd and restore order.
Kornilov's ultimate aim is unclear but he did want to remove the Soviet from its role.
He certainly saw Lenin as a German spy and the Bolsheviks undermining the army's efforts.
Kornilov may have also intended to replaced the PG and restore autocracy in a possible military dictatorship.
The PG needed to defend itself but did not have any control over the army due to Order No 1.
To defend Petrograd, the PG needed to call on the support of all loyal workers and arm them.
This meant the Bolsheviks could mobilise and organise large numbers of workers and soldiers into a defence force led by their "Red Guards".
The PG provided the Bolsheviks with arms and released several of their leaders from jail.
Many of these leaders were arrested in the July Days.
In the end, the railway workers prevented Kornilov from reaching the city and most of his soldiers refused to obey his orders.
The Bolsheviks enjoyed a huge surge in support as the defenders of the capital against the forces of counter-revolution without actually doing very much.