William Low left behind graphic accounts of how he slew rebels with his sabre and participated in a mass hanging of civilians during the two-year mutiny against British rule, which began in 1857.

The cavalryman also told how he came close to losing a hand and an ear in combat during the uprising, which is known in India as the first war of independence.

Mr Cameron has previously said that his ancestors were involved in “empire building” in India.

Had the full story of his great-great-grandfather’s involvement in suppressing the mutiny become public before Mr Cameron’s recent trip to the subcontinent, it could have caused diplomatic embarrassment.

The Prime Minister’s family tree was traced by the genealogist Nick Barratt, who worked on the BBC programme Who Do You Think You Are?

William Low was the grandfather of Sir William Mount, who married Elizabeth Llewellyn in 1929. The couple became Mr Cameron’s maternal grandparents.

In letters unearthed in the British Library by the Sunday Times, Low described how he mercilessly “cut down” the Indian rebels.

In one clash, his hand was cut to the bone and his ear was sliced open.

After another battle, the cavalryman wrote to his father, General Sir John Low: “The rebel infantry stood, but almost all their cavalry bolted. The result was that they were thoroughly beaten and dispersed, that upwards of 100 dead bodies were left on the field, while we lost but nine killed and wounded, two horses killed and seven wounded.

“Completely dispirited, the rebels then took themselves to their city, but the infantry were now well up and the place was, after considerable resistance, carried at the point of the bayonet, and the cavalry outside cutting up numbers of who endeavoured to escape. All the great man were captured and hung [sic].”