Lvov resigned as Prime Minister on 2 July 1917, after disagreements within the cabinet regarding the status of the Ukrainian People's Republic, which was in control of Ukraine. Tsereteli had travelled to Kiev with a party representing the Provisional Government to negotiate a means to ensure defence of Russia while respecting Ukrainian self-determination. The outcome saw the Ukrainians allow the Russians to continue to defend their territory, while granting increased autonomy, a move opposed by many in the cabinet. This came at the same time as the July Days, a major demonstration that broke out in Petrograd, and threatened the Provisional Government. The Provisional Government was able to withstand the threat, and Alexander Kerensky took over as Prime Minister. Though Tsereteli opposed Kerensky, seeing him as the force behind Lvov's resignation, he had little option but to consent to the move.