List of Prime Ministers of the United Kingdom by tenure - wikipedia List of Prime Ministers of the United Kingdom by tenure 20 years and 314 days Robert Walpole ( 1721 -- 1742 ) 18 years and 343 days William Pitt the Younger ( 1783 -- 1801 and 1804 -- 1806 ) 14 years and 305 days Lord Liverpool ( 1812 -- 1827 ) 211 days Bonar Law ( 1922 -- 1923 ) 130 days Lord Goderich ( 1827 -- 1828 ) 119 days George Canning ( 1827 ) This article lists each Prime Minister of the United Kingdom in order of term length. This is based on the difference between dates ; if counted by number of calendar days all the figures would be one greater. Of the 54 Prime Ministers, 9 served more than 10 years while 7 served less than 1 year. Robert Walpole is the only person to have served as Prime Minister for more than two decades. George Canning served for less than four months before his death. Ordered by tenure Rank Prime Minister Length by time served Premierships Party Start year Walpole ! Sir Robert Walpole 20 years, 314 days Whig 1721 Pitt ! William Pitt the Younger 18 years, 343 days Tory ( Pittite ) 1783 Liverpool ! The Earl of Liverpool 14 years, 305 days Tory ( Pittite ) 1812 Salisbury ! The Marquess of Salisbury 13 years, 252 days Conservative 1885 Gladstone ! William Ewart Gladstone 12 years, 126 days Liberal 1868 6 North ! Lord North 12 years, 58 days Tory ( Northite ) 1770 7 Thatcher ! Margaret Thatcher 11 years, 209 days Conservative 1979 8 Pelham ! Henry Pelham 10 years, 191 days Whig 1743 9 Blair ! Tony Blair 10 years, 56 days Labour 10 Palmerston ! The Viscount Palmerston 9 years, 141 days Whig / Liberal 1855 11 Asquith ! H.H. Asquith 8 years, 244 days Liberal 1908 12 Churchill ! Sir Winston Churchill 8 years, 239 days Conservative 1940 13 Wilson ! Harold Wilson 7 years, 279 days Labour 1964 14 Newcastle ! The Duke of Newcastle 7 years, 205 days Whig 1754 15 Baldwin ! Stanley Baldwin 7 years, 82 days Conservative 1923 16 Disraeli ! Benjamin Disraeli 6 years, 339 days Conservative 1868 17 Macdonald ! Ramsay MacDonald 6 years, 289 days Labour / National Labour 1924 18 Macmillan ! Harold Macmillan 6 years, 281 days Conservative 1957 19 Melbourne ! The Viscount Melbourne 6 years, 255 days Whig 1834 20 Major ! John Major 6 years, 154 days Conservative 21 Attlee ! Clement Attlee 6 years, 92 days Labour 1945 22 Cameron ! David Cameron 6 years, 63 days Conservative 23 Russell ! Lord John Russell 6 years, 11 days Whig / Liberal 1864 24 George ! David Lloyd George 5 years, 317 days Liberal 1916 25 Peel ! Sir Robert Peel 5 years, 57 days Conservative 1834 26 Derby ! The Earl of Derby 3 years, 280 days Conservative 1852 27 Heath ! Edward Heath 3 years, 259 days Conservative 1970 28 Grey ! The Earl Grey 3 years, 229 days Whig 1830 29 Balfour ! Arthur Balfour 3 years, 145 days Conservative 1902 30 Portland ! The Duke of Portland 3 years, 82 days Whig / Tory ( Pittite ) 1783 31 Addington ! Henry Addington 3 years, 54 days Tory ( Pittite ) 1801 32 Callaghan ! James Callaghan 3 years, 29 days Labour 1976 33 Chamberlain ! Neville Chamberlain 2 years, 348 days Conservative 1937 34 Wellington ! The Duke of Wellington 2 years, 320 days Tory 1828 35 Brown ! Gordon Brown 2 years, 319 days Labour 2007 36 Perceval ! Spencer Perceval 2 years, 221 days Tory ( Pittite ) 1809 37 Bannerman ! Henry Campbell - Bannerman 2 years, 122 days Liberal 1905 38 Grenville, George ! George Grenville 2 years, 85 days Whig ( Grenvillite ) 1763 39 Chatham ! The Earl of Chatham 2 years, 76 days Whig ( Chathamite ) 1766 40 Aberdeen ! The Earl of Aberdeen 2 years, 42 days Peelite 1852 41 Eden ! Sir Anthony Eden 1 year, 279 days Conservative 1955 42 May ! Theresa May 7002596000000000000 ♠ 1 year, 231 days ( Incumbent ) Conservative 2016 43 Wilmington ! The Earl of Wilmington 1 year, 119 days Whig 1742 44 Rockingham ! The Marquess of Rockingham 1 year, 113 days Whig ( Rockinghamite ) 1765 45 Rosebery ! The Earl of Rosebery 1 year, 109 days Liberal 1894 46 Grafton ! The Duke of Grafton 1 year, 106 days Whig ( Chathamite ) 1768 47 Grenville, William ! The Lord Grenville 1 year, 42 days Whig 1806 48 Home ! Sir Alec Douglas - Home 362 days Conservative ( Scot. Unionist ) 1963 49 Bute ! The Earl of Bute 317 days Tory 1762 50 Shelburne ! The Earl of Shelburne 266 days Whig ( Chathamite ) 1782 51 Devonshire ! The Duke of Devonshire 225 days Whig 1756 52 Law ! Bonar Law 211 days Conservative ( Scot. Unionist ) 1922 53 Goderich ! The Viscount Goderich 130 days Tory ( Canningite ) 1827 54 Canning ! George Canning 119 days Tory ( Canningite ) 1827 See also List of Prime Ministers of the United Kingdom List of Prime Ministers of the United Kingdom by age William Pulteney, 1st Earl of Bath ( sometimes listed as a prime minister ; held office for 2 days in 1746 ) James Waldegrave, 2nd Earl Waldegrave ( sometimes listed as a prime minister ; held office for 4 days in 1757 ) External links `` Past Prime Ministers ''. gov.uk. Government of the United Kingdom. Archived from the original on 25 August 2008. Lists relating to Prime Ministers of the United Kingdom List of Prime Ministers of the United Kingdom Lists by order Age Constituencies Cultural depictions Governments Historical rankings Number living Records Service ( timeline ) Term length Peerages By monarch Victoria Edward VII George V Edward VIII George VI Elizabeth II Personal life Burial places Coats of arms Education Nickname Spouse In fiction Fictional Prime Ministers Retrieved from `` https://en.wikipedia.org/w/index.php?title=List_of_Prime_Ministers_of_the_United_Kingdom_by_tenure&oldid=828143075 '' Categories : Lists of people by time in office Lists of Prime Ministers of the United Kingdom Talk About Wikipedia Add links This page was last edited on 28 February 2018, at 20 : 29. About Wikipedia

Question: who was the longest serving prime minister of britain
Answer: Robert Walpole