Michael returned to Gatchina and was not permitted to return to his unit or to travel beyond the Petrograd area. On 5 April 1917, he was discharged from military service. By July, Prince Lvov had resigned as Prime Minister to be replaced by Alexander Kerensky, who ordered ex-Emperor Nicholas removed from Petrograd to Tobolsk in the Urals because it was "some remote place, some quiet corner, where they would attract less attention". On the eve of Nicholas's departure, Kerensky gave permission for Michael to visit him. Kerensky remained present during the meeting and the brothers exchanged awkward pleasantries "fidgeting all the while, and sometimes one would take hold of the other's hand or the buttons of his uniform". It was the last time they saw each other.