The greatest scandal in the history of the British Parliament had everything: sex, cash for honours, a feud within the Royal Family, and more – and all long before Jack Profumo, or Lord Levy or the Princess of Wales was born. In fact, its bicentenary is just a few days away.

In January 1809, a parliamentary commission held a public inquiry into allegations of corruption in the Army. It was alleged that, in the midst of a war with Napoleon, rich young men were buying their way in and out of lucrative commissions. The main witness before the inquiry was a sensationally attractive woman named Mary Clarke, whose evidence so transfixed some of her male listeners that they sent her private notes afterwards seeking a chance to get to know her better, in more intimate surroundings.

Bribery, betrayal, extravagance, political intrigue and the aforementioned feud in the Royal Family... the Mary Clarke scandal only lacked a sensation-driven tabloid press to titillate the nation with daily revelations but a literate minority were able to follow every sordid detail in the cheap pamphlets on sale in London.

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

At its centre was a man who is still a household name – Frederick Augustus Hanover, that Grand Old Duke of York who had ten thousand men. The nursery rhyme commemorates his disastrous record on the battlefield. His statue can be seen on a column 123ft high, near the Mall, just off Trafalgar Square. The Duke was Commander in Chief, and the favourite son of King George III – the only one of that monarch's numerous children who showed any talent for anything. Though he was a bad field commander, he was a competent organiser who raised the professional level of the army and founded Sandhurst College.

In common with George's other sons, he could not stand his wife. In 1803, he set up house with the lovely Mary Clarke, stepdaughter of a printer, brought up in Bowling Inn Alley, near Fleet Street. She has a deceptively innocent expression in her surviving portraits. Innocence, however, was not one of her many qualities. Married off at 15, she had sent her husband packing because he drank, and was intent on bringing up her daughters as fashionable ladies by making money through the only means available to her.

For two years, Mary Clarke's luxurious home was a centre of London society. At a time when ladies were expected to read romantic novels, Ms Clarke boasted that she had never read a novel in her life, but she had studied the works of most of the political essayists and military theorists of her time. Her private diaries, which are kept in an archive in Reading, are written in the confident sloping handwriting of a well-educated woman. She was obviously more intelligent and strongwilled than the Duke and it was rumoured that she had more sway in military matters than was proper for a kept woman. A furious officer, Major Denis Hogan, even alleged that he had been denied promotion because he had refused to "kiss the petticoat" – for which he was sued for libel.

Eventually, the Duke tired of his lively mistress but promised her an annuity for life of £400 a year so her daughters would not have to follow their mother's profession. Sadly, he was hopeless with money and extravagant beyond the means even of a royal prince. In one year, he drank and gambled his way through £40,000. He could not keep up the payments, and she was left, she claimed, "pursued by creditors, harassed and distressed by threats, which afforded my future life no other prospect but the walls of prison".

She took refuge in a house in Hampstead, then a village outside London, where there was another lodger, named Sir Richard Phillips, a radical, who had spent time in jail for being a suspected republican. He tipped off Gwyllym Wardle, the MP for Okehampton, that the aggrieved Ms Clarke had a tale worth hearing. In January 1809, Col Wardle stood up in the Commons and sensationally accused the King's son of corruption. He then produced his glamorous witness, who frankly testified that, throughout the time when she was the Duke's mistress, she was selling commissions to would-be officers.

The deal was that someone who wanted a military rank, or a promotion, would pay Ms Clarke and, as she was about to climb into bed with His Grace, she would insist he agree to whatever the client had paid for – or do without his rumpy-pumpy.

All this instantly became public knowledge because a private printer named Thomas Hansard had recently secured a contract to publish parliamentary proceedings. An entry in Mary Clarke's diary for 9 April 1809 records: "Met Mr Hansard. He has in the past instance brought notes in his own handwriting there transactions of MPs."

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

The general public was less shocked by the corruption than by the sexual immorality. Everyone knew the system was crooked, but having the details of the private life of a Royal Duke laid bare was a salacious novelty. There were dreadful rumours going around that Ms Clarke had been paid for her evidence, as part of a conspiracy against the Duke, bankrolled by his incompetent and spiteful younger brother, Edward, Duke of Kent. As governor of Gibraltar, Edward had provoked the garrison to mutiny, after which the Duke of York ordered him off the colony. In February 1809, the Duke of Kent admitted in the House of Lords that he had fallen out with his brother but he absolutely denied anyconnection with Mary Clarke. Col Wardle also asserted that she had given her evidence of her own free will, out of pure patriotism.

It was all acutely humiliating for the Duke of York, who had tried to build a reputation for promoting officers on their merit. His defence was that he had never realised what his mistress was doing, which allowed the cartoonists of the day to have fun with the idea that the army was being secretly run by a woman. Although the Duke was stupid, extravagant, and immoral, he was not vindictive, and people liked him, so the Commons decided to accept his excuse, and voted by 278-196 to clear him of corruption. He resigned his post as Commander in Chief, only to be reinstated after two years.

Wardle, meanwhile, became a national hero. In the archives in Reading, there are numerous documents recording how the freemen of town or cities such as Sheffield had unanimously passed a vote of thanks to him for cleaning up the army. But he stupidly repeated the very mistake that had been the Duke of York's undoing. He had secretly promised Mary Clarke that, in reward for her testimony, she would get £5,000 in cash, all her debts paid, her £400 a year annuity restored, and a new house furnished according to her expensive taste. She had already moved into the new house in Chelsea.

But when it came to paying for the furniture, trouble started. The rest of the money never materialised. Against the advice of her friends, she took her revenge by publishing a book that revealed the whole conspiracy against the Duke of York, which had been orchestrated by the Duke of Kent's private secretary. She also told the world that Col Wardle, who had so publicly denounced the Duke of York's sexual immorality, had a mistress whom he kept under a false name, above a coffee shop in Sloane Street.

As to the suggestion that Mrs Clarke had exposed the Duke of York for any motive other than money, did anyone – she demanded furiously – think she was that stupid?

She had done it to avoid debtor's prison. "Is it to be made a matter of surprise," she said, "that any woman, so situated, with an infant family to support and protect, should be glad to catch any offer that would remove from my distracted vision those dreadful phantoms of misery?"

To trash the reputation of one Duke was risky. Mary Clarke had now traduced two, and soon England became too dangerous a place for her. She fled to France. Her daughter, Ellen, married a Frenchman named Busson du Maurier. Their son, George, married an Englishwoman and moved to London with her.

George's son was Sir Gerald du Maurier, an actor, and father of Daphne du Maurier, one of whose novels, Mary Anne, tells the tale of a woman of strong character who seduced the son of the King. Du Maurier was recounting the scandalous life of her own great-great grandmother.

Red-faced royal: A pointed poem

Oh, the Grand Duke of York

He had ten thousand men

He marched them up to the top of the hill

And he marched them down again.

And when they were up, they were up.

And when they were down, they were down.

And when they were only half way up

They were neither up nor down.

Most people know the rhyme but not many know its origin. It refers to an ignominious defeat that the British and Austrian armies suffered at Tourcoing in Flanders, in May 1794. When the British went into battle against the French in those days, they expected to win. There were plenty of people alive who could remember Wolfe's conquest of Quebec, and everyone had grown up with folk memories of the mighty Duke of Marlborough, and distant heroes like Prince Hal. So they did not think much of the Duke of York losing to an outnumbered revolutionary rabble who had had the effrontery to guillotine their King. Within a few years, of course, Napoleon would teach most of Europe that it was normal to lose against the French.