William Petty , 1st Marquess of Lansdowne , KG , PC ( 2 May 1737 â `` 7 May 1805 ) was a British Whig statesman and Prime Minister of Great Britain . William Petty-FitzMaurice , 1st Marquess of Lansdowne , KG , PC ( 2 May 1737 â `` 7 May 1805 ) , known as The Earl of Shelburne between 1761 and 1784 , by which title he is generally known to history , was an Irish-born British Whig statesman who was the first Home Secretary in 1782 and then Prime Minister 1782 â `` 1783 during the final months of the American War of Independence .