One’s a pint-swigging right-wing loudmouth, the other’s the British Prime Minister.

But both are of the same stock, according to newly-released family records.

Comedian Al Murray and David Cameron are distant cousins related, equally randomly, through 19th-century Vanity Fair writer William Thackeray.

Download the new Independent Premium app Sharing the full story, not just the headlines

The unlikely link was uncovered after some 2.5 million files on Europeans living in India from 1698 to 1947 were researched.

As it turns out, Mr Cameron’s great-great-great-great-grandfather (count the greats) was Talbot Shakespear, a senior civil servant for the East India Company.

Shakespear was also the uncle to Murray’s great-great-great-grandfather Thackeray, which makes the pair distant cousins.

The India Office’s records on Shakespear also contained a list of his possessions and details of his fortune, which is apparently worth £57m in today’s money.

The genetic link could be the first of many to be revealed, as website findmypast.co.uk make the records publicly available for the first time this week.

Files on individuals of note include writers Rudyard Kipling and George Orwell.