Edward George Geoffrey Smith-Stanley , 14th Earl of Derby , KG , PC ( 29 March 1799 â `` 23 October 1869 ) was an English statesman . He served as Prime Minister of the United Kingdom three times . Edward George Geoffrey Smith-Stanley , 14th Earl of Derby , KG , PC ( 29 March 1799 -- 23 October 1869 ) was an English statesman , three times Prime Minister of the United Kingdom , and to date the longest serving leader of the Conservative Party .