Tony Blair formed the Blair ministry in May 1997 after being invited by Queen Elizabeth II to form a new government following the resignation of the previous Prime Minister of the United Kingdom, John Major as a result of the Labour Party victory in the 1997 General Election. He would serve as the Prime Minister for three successive parliamentary terms until his resignation on 27 June 2007. His Cabinet was reshuffled for each new parliament along with a few minor changes during each term.