The Royal Agricultural University in Cirencester is known as the ‘Oxbridge of the countryside’.

The sons and daughters of some of Britain’s biggest landowners are students at the college, which enjoys the patronage of Prince Charles. The campus, set in 25 manicured acres in Gloucestershire, is close to Highgrove, his country home.

The official university motto is: ‘Avorum Cultus Pecorumque’: ‘Caring for fields and beasts.’ But the unofficial motto, prospective undergraduates are informed in the current brochure, is ‘work hard, play hard.’

Thady Duff and James Martin (right) were two of the four students cleared of rape and sexual assault after a ball at the Royal Agricultural University

Nowhere is this maxim (at least, the having fun part) more in evidence than at the annual May Ball. The black-tie do is the highlight of the RAU social calendar.

One of the most lavish took place in 2014. It is also the starting point for the disturbing events you are about to read.

The theme for the night was the Mad Hatters’ Tea Party.

No expense was spared. The grounds were transformed into a fantasy realm of Alice In Wonderland characters with the Mad Hatter himself welcoming ball-goers to Wonderland — ‘partying from dusk ‘til dawn’, live entertainment, funfair rides and, naturally, an unlimited supply of alcohol.

The traditional ‘survivors’ photograph of those left standing the following morning features a motley line-up of dishevelled young women and young men minus their dinner jackets and shirts.

‘We fell down the “rabbit hole” at about 8.30pm and, despite a quick 3.30am nap, didn’t resurface again until the “survivors’ photo”,’ one student wrote on the internet at the time.

Two days after the photocall, four of those who attended the riotous event — three male students and a guest — were arrested.

A woman, they were told, had come forward and accused them of gang raping her during the party. They vehemently denied the accusation. She was lying, they said. The police, however, believed her, not them.

All four, among them talented polo player Thady Duff, 22, were subsequently charged with multiple counts of rape and sexual assault. A depressingly familiar aspect of the night in question was that a pornographic video was made of the proceedings and shared on social media.

Leo Mahan and Patrick Foster (right) were the other members of the group cleared of all charges after prosecutors could offer no evidence against them

The resulting publicity confirmed the opinion many had of the university: that behind its royal credentials — Prince Charles has been president of the establishment for three decades — a macho culture, fuelled by boorish, drunken toffs, was prevalent at the college.

For years, students were banned from a number of local pubs because of wild behaviour epitomised by the antics of the male-only drinking club, Hedgehogs, Cirencester’s equivalent of Oxford’s notorious Bullingdon Club.

To the outside world, Thady Duff and his friends might have fitted this stereotype. But, we now know, while they may have been guilty of bad behaviour, they were not rapists.

For this week the case against them fell apart. ‘The Crown’s view is that there is no realistic chance of a conviction and so we offer no evidence,’ the prosecuting barrister told Gloucestershire Crown Court, where the trial was due to have begun on Monday.

No evidence — after a criminal investigation lasting nearly two years? Two years in which the defendants and their families were dragged through ‘hell’ (their word).

There was evidence, of course. But it was ‘exculpatory evidence’, to use the precise legal term, meaning evidence favourable to the defendant had been found. Little of this evidence, however, had been disclosed to the defence until the eve of the scheduled trial. Hence the reason for the judge dramatically drawing a halt to the proceedings.

But there is much more we can reveal today, not only about the flawed investigation but about the girl’s past, and about the detective accused in court of ‘vandalising’ the case by Edward Henry, the barrister representing co-accused James Martin.

Data on the girl’s mobile phone, according to our own inquiries, hinted that she may have consented to group sex with Mr Duff and his friends and revealed her to be a young woman with an extraordinary sexual appetite.

Illustrious: The Royal Agricultural University in Cirencester is known as the ‘Oxbridge of the countryside'

This evidence, we have been told, included naked pictures she sent to Duff in advance of the May Ball. That alone should have been enough to cast serious doubt on her story.

There were also messages pointing to sexual encounters with men on the online dating app Tinder almost every night — sometimes with more than one man a night — as well as material showing that she had filmed herself having sex in the past.

Did detectives ‘cherry-pick’ and ‘bury’ most of this evidence in an attempt to secure a conviction? Or did they simply fail to properly scrutinise the information on the woman’s phone, which ran to thousands of screen pages?

Either way, the lives and reputations of four young men were all but destroyed by the scandalous shortcomings in the criminal investigation.

In the court of public opinion, as one commentator put it, ‘the doctrine of the “no smoke without fire lobby” is far more potent than the principle of “innocent until proven guilty”,’ especially in rape cases.

The four accused students were suspended from university and their parents had to take out loans to pay legal fees. One of the families even had to remortgage their house.

Had they been convicted, Thady Duff, Patrick Foster, Leo Mahon, and James Martin could be facing prison sentences of more than ten years.

Royal connection: Prince Charles has been president of the farming college for three decades

And while their own names have been dragged through the mud over the past two years, the woman who falsely accused them cannot be identified. The law grants anonymity to those who make charges of sexual abuse.

So, here is what we can tell you about her. She is in her 20s and from a good family. She has a lively sexual history.

Under different circumstances, her sexual history would matter not a jot. Only the most strident feminists, though, could believe it was not relevant in this case.

Still, she was no different from many modern young women. Female students at Cirencester like to have fun. Some of them recently posted a number of saucy photos online. One shows two girls smoking and drinking in a bath together wearing nothing but frilly black knickers, and in another, a young woman is clutching a bottle of port to her naked chest.

The girl at the centre of the May Ball imbroglio is understood to have met Thady Duff around two years ago.

Mr Duff lives in the village of Blunsdon, near Swindon, with his mother Melanie, a former Tory councillor for Swindon Council, and ex-Mayor of nearby Highworth.

She represented Ireland in the individual and team eventing competition at the Barcelona Olympics in 1992 and now runs a livery in Wiltshire.

Mrs Duff is on personal terms with Princess Anne’s daughter Zara Phillips. The two co-owned Zara’s favourite horse Tsunami II, which died in cross-country accident in France eight years ago.

Thady Duff, a pupil at the prestigious public school Cheltenham College before enrolling at the Cotswolds campus, is a talented rider himself and a member of the Beaufort Polo Club.

All four friends, in fact, are accomplished horsemen, the one thing they all have in common.

Mr Duff and Patrick Foster, 22, the son of a civil engineering contractor, who went to £30,000-a-year boarding school Felsted in Essex, attended the recent VWH Hunt Ball at Cirencester Park polo Club, which was featured in society magazine Tatler.

Leo Mahon, 22, from a farming family in Stratford-upon-Avon, and apprentice farrier, James Martin, 20, brought up in Chipping Norton, Oxfordshire (the only member of the group not studying at the Royal Agricultural University), are both amateur jockeys.

Pictures on social media show them enjoying black-tie functions. But how could they possibly have imagined the nightmare that lay ahead when they donned their dinner jackets once again for that fateful May Ball on May 23, 2014?

Anger: James Martin with his father Andy after leaving court. Mr Martin's barrister said there needed to be a review into the handling of the case against his client

Spirits were high. Three of them (Duff, Foster, and Mahon) were celebrating the end of their finals. At some point during the party they all ended up with the young woman along with James Martin, a guest at the event. The gathering culminated in a group sex session.

Afterwards, the girl found out that the encounter had been filmed (by Thady Duff, allegedly) on his mobile phone and shared on social media.

The girl, as we mentioned earlier, had filmed herself having sex in the past, but this time she was not in control of the material. She was mortified. She went to a student welfare officer, said she had never consented to being filmed, and was persuaded to take the matter to the police. All this, is alluded to in the ‘buried evidence’ on her own phone.

Was this, then, the real motive for the rape claim? Embarrassment?

She was examined by a doctor after making the rape allegation when the usual swabs were taken. The results, according to a source within the Gloucestershire force, showed she had also had sex with a fifth individual around the time of the May Ball.

So, five men in total.

Two days after the fateful party, on May 25, Thady Duff and his friends were arrested. But it took almost two more years for the case to get to trial, which, in itself, is a damning indictment of the police inquiry.

One detective in particular accused of ‘vandalising’ the case by James Martin’s barrister Edward Henry is Detective Constable Ben Lewis, who is based at the Gloucestershire Police headquarters.

The force does not have a specialist rape unit but 38 officers have undergone training to work on sexual offence investigations. DC Lewis is believed to be one of these officers and liaised closely with the woman in this story.

It would be unfair, though, to place the blame entirely on DC Lewis. He was not the only officer working on the case. Nevertheless, all concerned have difficult questions to answer.

Meanwhile, back to the girl. Why was she sending naked photographs of herself to Duff shortly before the May Ball? And why did police fail to share all information they had with the defence?

The trial against the group collapsed on the day it was due to start at Gloucester Crown Court (pictured)

Disclosure is one of the most important issues in the criminal justice system. The ‘golden rule’, according to the Attorney General’s Guidelines, is that ‘fairness requires full disclosure of all material held by the prosecution that weakens its case or strengthens that of the defence’.

That rule could not have been more flagrantly broken here.

Just one example. Five months after the May Ball, the same young woman was a witness in another rape case involving an Army officer. But she proved to be an utterly unreliable witness, giving ‘different accounts’ of the alleged assault, and he was cleared.

DC Lewis is understood to have known about this but the information was not passed to the Crown Prosecution Service and only recently became known to the defence. It was this revelation that ultimately led to the collapse of the May Ball trial.

The detective has also faced criticism of a different kind, which went largely unreported. ‘The phone evidence reveals key matters that took place when the complainant was given all sorts of information she should not have been given,’ Mr Duff’s barrister Eleanor Laws QC, told the court.

‘Information that could only have come from the officer in the case. Details of witness statements, details of defendants’ interviews, details of what was found on the defendants’ clothing.

‘The officer had disclosed everything to her knowing full well she could discuss it with other witnesses. Given what we now know about the complainant, could it have been proper to go ahead with the prosecution in the first place?’

Indeed, many might argue, that it is Gloucestershire Police and the young woman herself who should have been in the dock, not Thady Duff and his friends, however much we might disapprove of their behaviour on the night of that now infamous May Ball.