What happens when a British Prime Minister resigns?

UK Prime Minister Boris Johnson as he leaves 10 Downing Street in central London on Wednesday to head to the Houses of Parliament for the weekly Prime Minister's Questions session.

London (CNN)UK Prime Minister Boris Johnson announced his resignation on Thursday following mounting pressure from lawmakers in his own party to stand down.

Under the UK political system, between elections, only Conservative members of Parliament have the ability to remove a sitting Conservative Prime Minister.
So, what happens to the UK government when a Prime Minister resigns, and how is a new leader elected?

    When will a new leader be in place?

      During his statement Johnson said he will not leave office immediately, but will wait until his successor is chosen.
      "I've today appointed a cabinet to serve, as I will, until a new leader is in place," he said.
      Johnson said that the timeline for the process will be announced next week, but it has been suggested he could remain in power until the Conservative Party conference in October.
        Former British Prime Minister Sir John Major said it would be "unwise and may be unsustainable" for Johnson to remain in office for an extended period of time while a new Conservative leader is chosen.
        "The proposal for the Prime Minister to remain in office -- for up to three months — having lost the support of his Cabinet, his Government and his parliamentary party is unwise, and may be unsustainable," Major wrote in a letter to the Chairman of the 1922 Committee of Conservative backbenchers, Graham Brady.
        And Dominic Cummings, who served as Johnson's most senior adviser before becoming an outspoken critic of the Prime Minister, warned against allowing him to stay in post.
        "We're all in for a nightmare if he's allowed to squat," said Cummings.
        Recent precedent shows that the time taken to choose a new leader can vary.
        After Theresa May resigned on May 24, 2019 it took until July 24 for Boris Johnson to take over, but when David Cameron resigned on June 24, 2016 it took just a few weeks for May to take office on July 13.

        Who will be Prime Minister while all this happens?

        As Johnson indicated in his resignation speech, he plans to stay in office until a successor is chosen.
        That's what would happen under normal circumstances: A Prime Minister who has resigned as party leader stays in office as caretaker Prime Minister until there is a new party leader.
        But it's not clear that the Conservative Party will stand for that in Johnson's case.
        One alternative would be for Deputy Prime Minister Dominic Raab to step in as caretaker. There's no precedent for that -- but there's also no precedent for more than 50 government officials to resign in two days in order to force a Prime Minister out.

        Will Johnson's resignation trigger a general election?

        No. It starts the Conservative Party process for choosing a new leader of the party.
        UK Prime Ministers are not directly elected by the people; Johnson is Prime Minister because he is the head of the largest party in the House of Commons.
        The Conservatives will still be the largest party after Johnson quits, so the new head of the party will become Prime Minister.

        How is the new Conservative Party leader chosen?

        Leadership candidates need the support of at least eight lawmakers.
        If there are more than two candidates, Conservative Party lawmakers hold round after round of votes to whittle the number of leadership candidates down to two.
        Then Conservative Party members nationwide vote -- by mail -- between the two finalists.
        The winner becomes leader of the party -- and Prime Minister.