The Prime Minister of the United Kingdom is the head of the Government of the United Kingdom, and chairs Cabinet meetings. There is no specific date for when the office of Prime Minister first appeared, as the role was not created but rather evolved over a period of time through a merger of duties. The term had been used in the House of Commons as early as 1805, and it was certainly in parliamentary use by the 1880s. In 1905 the post of Prime Minister was officially given recognition in the order of precedence. Modern historians generally consider Sir Robert Walpole, who led the government of Great Britain for over twenty years from 1721, as the first Prime Minister. Walpole is also the longest-serving British prime minister by this definition. However, Sir Henry Campbell-Bannerman was the first and Margaret Thatcher the longest-serving Prime Minister officially referred to as such in the order of precedence. The first to officially use the title was Benjamin Disraeli, who signed the Treaty of Berlin as "Prime Minister of her Britannic Majesty" in 1878.
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, i.e. 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 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.