List of Prime Ministers of the United Kingdom (graphical)
20th and 21st centuries
This timeline shows most of the early life, the political career and death of each Prime Minister of the United Kingdom from 1846. The first Prime Minister was Robert Walpole in the early 18th century.
Unlike countries where the leader is elected directly to the highest political office of a separate executive, the Prime Minister must first establish a political career in the UK Parliament and typically serves many years in the House of Commons before becoming Prime Minister, and in some cases for many years afterwards.
Since the Marquess of Salisbury in 1895, all time in parliamentary service before being Prime Minister has been in the House of Commons, apart from Sir Alec Douglas-Home's period as a member of the Government while in the House of Lords 1951-63 (though he was previously the elected member for Lanark 1931-1945). Before becoming Prime Minister he was returned to the Commons by winning a by-election on the recess death of MP Gilmour Leburn a member of the Conservative's sister party the Unionist Party (Scotland).
- Each dark coloured bar denotes the time spent as Prime Minister
- A light colour denotes time spent in Parliament before or after serving as Prime Minister
- A grey colour bar denotes the time the Prime Minister spent outside Parliament, either before or after their political career
- changed party: Viscount Palmerston, Earl of Derby, Gladstone, Churchill (twice)
- died in office: Canning, Palmerston
- died shortly after leaving office: Campbell-Bannerman, Bonar Law, Chamberlain
- left Parliament on leaving office: Russell, Baldwin, Blair, Cameron
- long career after being Prime Minister: Rosebery, Balfour, Lloyd George, Heath
- served as Prime Minister after an interruption to their political career: MacDonald, Churchill, Macmillan (twice), Douglas-Home
- lived for more than twenty years after leaving Parliament: Macmillan, Douglas-Home, Thatcher
- assassinated: Perceval