As the Duke of York is discovering, there’s nothing like a juicy scandal involving the rich and powerful to engross a nation, writes Sandra Dick.

Stone ruins, three storeys tall and with a gaping hole down one side are all that remain of what was once one of Scotland’s most impressive estates.

In its day so forbidding that it inspired Sir Walter Scott to conjure up his tale Castle Dangerous, it stands on a patch of Lanarkshire land held by the Douglas family since the 13th century, the gloomy ruins just off the M74 now just a tiny shadow of what was once their very grand estate.

Loaded with power, wealth and status, with extensive royal and political connections, at its peak the Douglas dynasty was among Scotland’s premier families.

Yet 250 years ago this year, their powerful foundations would be rocked by scandalous allegations that gripped the nation and placed them at loggerheads with another of Scotland’s richest and most powerful families, the Hamiltons.

So outrageous were the claims that as the remarkable dispute unfolded people took to the streets of Edinburgh to rampage and attack the homes of the Scottish judges who dared to give their learned verdict.

Talk of the remarkable legal quarrel involving a fake pregnancy, mounting debts and a meandering trail which led from Lanarkshire to the unlikely doors of a Parisian glassblower and "rope dancer" echoed through Enlightenment drawing rooms and humble homes across Europe before reaching a stunning conclusion at the House of Lords in 1796.

Even then, the fallout from the scandal tainted lives and raised questions over the actions of Scotland’s most prominent families.

While it all played out 250 years ago, recent images of the Duke of York squirming in the face of distasteful allegations have shone a dazzling spotlight on how easily the rich and famous can find their cosy lives ruthlessly unpicked in public, dividing opinion and staining reputations.

The astonishing story of the 18th century inheritance wrangle between the then Duke of Hamilton and the heir to the Douglas estate has been unravelled in a BBC Radio Scotland episode of author Denise Mina’s Case Histories, one in a series of programmes which picks over scandals, crimes and courtroom clashes which continue to fascinate years after the case is closed.

And while the squabble may have been largely forgotten today, she points out that it was an inheritance scandal come soap opera which kept tongues wagging long after it reached what some considered to be a very unsatisfactory conclusion.

“There are so many elements to it,” she explains. “It’s about the ’45 uprising, £nlightenment versus romanticism, it’s very rich people attacking each other.

“The sums of money involved are huge. It’s got it all.”

At its heart is the ageing, eccentric and illiterate Duke of Douglas, handed his Dukedom by Queen Anne as a child in a bid to secure the family’s loyalty in the face of Jacobite rumblings.

Almost a recluse, unmarried and with no direct heir, his massive estate – including a £12,000-a-year inheritance worth an estimated £800,000 in today’s money and ownership of around a third of Scottish land – seemed set to fall into the hands of his kinsmen, the massively powerful Hamiltons, the vastly rich owners of estates covering a quarter of Scotland.

But if the Hamiltons were rubbing their hands in glee at the prospect, they would be disappointed, points out Glasgow Caledonian University law lecturer Andrew Tickell.

“The Duke’s sister is Lady Jane Douglas. She’s in her late 40s, never met a match in the early productive years of her life,” he says. “And at 48 years old with no children, it seems likely the beneficiaries of the estate will be the Hamiltons.”

However, he adds, almost out of the blue, Lady Jane is whisked into marriage by the penniless yet charming 60-year-old Colonel John Stewart, described by her enraged brother as a "wore-out old rake".

Perhaps not surprisingly, her remarkable delivery of twin boys in Paris while in her fifth decade quickly sparked rumours of underhand dealings, tales of possible kidnapping and allegations that the infants, Archibald and Sholto, had been purchased with a view to securing the Douglas fortune.

Furious, her brother refused to accept them and cut Lady Jane’s allowance leaving her destitute and with a penniless husband languishing in a debtors’ prison.

Sholto’s death is said to have plunged her into deep grief, sparking her own rapid demise.

With his mother dead and his father mired in debt, young Archibald’s fate may have seemed sealed. Until, in a plot twist worthy of a Netflix drama, the elderly Duke unexpectedly sprang into action, and fell hopelessly in love with a woman 20 years his junior.

Encouraged by his new wife to embrace his questionable grandson, the Duke agreed to name Archibald as his rightful heir, before promptly dying.

As Mina points out in the programme, however, the twists in the tale kept coming, thanks to the hugely aggrieved Hamilton family. Determined not to see their potential inheritance fall to a child allegedly bought in the slums of Paris, their subsequent legal battle spanned eight years and cost both sides upwards of £54,000.

What they needed to succeed, she adds, was evidence.

To support their claims, the Hamiltons dispatched an 18th-century version of a private detective to retrace Lady Jane’s steps through Europe and to Paris.

There, explains Mina, emerged two unlikely characters – a Parisian glassblower and a "rope dancer", thought to be a trapeze artist – both of whom claimed to have lost their infant boys into what appears to be the hands of a man matching the smooth-talking Colonel Stewart.

Claims and denials were played out by two dozen lawyers before 15 judges at the Court of Session in July 1766, much to the fascination of the Scottish public. Around £100,000 worth of bets were laid on its outcome.

With the judges split, the decision hinged on the casting vote of the Lord President, Robert Dundas, whose declaration in favour of the Hamilton family infuriated many who took to Edinburgh’s streets to besiege the homes of the judges and Hamilton supporters.

But as Mina points out, although long dead, Lady Jane would still play a key role in deciding her son’s future.

With an immediate appeal lodged at the House of the Lords on behalf of the teenage Archibald, support grew from key figures including the outspoken James Boswell who made his feelings known in various publications and newspapers.

“This case was a bit like the OJ Simpson case today,” says Mina, “there’s much more going on than at first seems.

“These families were the oligarchs of their day, and the case is proxy for all sorts of other things; it’s not long after the ’45 uprising, while on one hand you have reasoned deduction that a woman of 50 years old doesn’t just produce twins and the other this romantic view that it could happen.”

The House of Lords ruling for Archibald was largely a vote for his mother, positioned in the case as a noble woman of honour and religious devotion, incapable of conjuring up such a wicked deception.

While his supporters celebrated by smashing the Hamilton family apartments at the Palace of Holyroodhouse, Archibald collected the Douglas fortune and became one of Scotland’s richest men, a politician and the 1st Baron Douglas.

Two centuries later, one of his descendants, William Douglas Home, would become a playwright and politician. Another, Alec Douglas-Home, went further, to become Prime Minister in 1963.

Meanwhile, the Hamilton and Douglas families would later merge through marriage – leaving the Douglas-Hamilton name one of Scotland’s most recognisable.

“What’s fascinating is that a small boy from the backstreets of Paris inherited that enormous fortune, that families were at war and this story enters the zeitgeist,” adds Mina.

“It’s where stories like Charles Dickens’ Bleak House come from, and these inheritance stories were familiar for hundreds of years afterwards because of the Douglas Cause.”

• Denise Mina’s Case Histories is on BBC Radio Scotland on Tuesday at 1.30pm and available to listen to online.