Strictly, the first Prime Minister of the United Kingdom (of Great Britain and Ireland) was William Pitt the Younger. The first Prime Minister of the current United Kingdom (the United Kingdom of Great Britain and Northern Ireland) was Bonar Law, although the country was not renamed officially until 1927 when Stanley Baldwin was the serving Prime Minister.
Due to the gradual evolution of the post of Prime Minister, the title is applied to early prime ministers only retrospectively; this has sometimes given rise to academic dispute. Lord Bath and Lord Waldegrave are sometimes listed as prime ministers. Bath was invited to form a ministry by King George II when Henry Pelham resigned in 1746, as was Waldegrave in 1757 after the dismissal of William Pitt the Elder, who dominated the affairs of government during the Seven Years' War. Neither was able to command sufficient parliamentary support to form a government; Bath stepped down after two days, and Waldegrave after three. Modern academic consensus does not consider either man to have held office as Prime Minister, and they are therefore not listed.
Prior to the Georgian era, the Treasury of England was led by the Lord High Treasurer. By the late Tudor period, the Lord High Treasurer was regarded as one of the Great Officers of State, and was often (though not always) the dominant figure in the government: Edward Seymour, 1st Duke of Somerset (Lord High Treasurer, 1547–1549), served as Lord Protector to his prepubescent nephew King Edward VI; William Cecil, 1st Baron Burghley (Lord High Treasurer, 1572–1598), was the dominant minister to Queen Elizabeth I; Burghley's son Robert Cecil, 1st Earl of Salisbury, succeeded his father as chief minister to Elizabeth I (1598–1603) and was eventually appointed by King James I as Lord High Treasurer (1608–1612).
By the late Stuart period, the Treasury was often run not by a single individual (i.e. Lord High Treasurer) but by a commission of Lords of the Treasury, led by the First Lord of the Treasury. The last Lords High Treasurer, Lord Godolphin (1702–1710) and Lord Oxford (1711–1714), ran the government of Queen Anne.
After the succession of King George I in 1714, the arrangement of a commission of Lords of the Treasury (as opposed to a single Lord High Treasurer) became permanent. For the next three years, the government was headed by Lord Townshend, who was appointed Secretary of State for the Northern Department. Subsequently, Lord Stanhope and Lord Sunderland ran the government jointly, with Stanhope managing foreign and Sunderland managing domestic affairs. Stanhope died in February 1721 and Sunderland resigned two months later; Townshend and Robert Walpole were then invited to form the next government. From that point, the holder of the office of First Lord also usually (albeit unofficially) held the status of Prime Minister. It was not until the Edwardian era that the title Prime Minister was constitutionally recognised. The Prime Minister still holds the office of First Lord by constitutional convention.