A senior judge has today agreed four students falsely accused of gang rape can pursue £221,000 costs as he criticised police for 'cherry-picking' evidence to help the complainant.

Judge Jamie Tabor QC told Gloucester Crown Court that Detective Constable Ben Lewis, who is still on active duty, got too close to the woman and did not understand his job properly.

Thady Duff, Leo Mahon and Patrick Foster, all 22, and James Martin, 20, were arrested after a group sex session at a summer ball at the Royal Agricultural University in Cirencester.

The case against the students fell apart before trial after it emerged the woman, who cannot be named, had given 'different accounts' as a witness in another rape case.

Texts she sent on the night were not revealed and the court heard there were suggestions she had previously shown an interest in group sex.

Cleared: Leo Mahon, Patrick Foster, Thady Duff and James Martin (all pictured left to right) were found not guilty of rape after a botched prosecution - they can now pursue their £221,000 costs

The students have been left with legal bills totalling £221,000 after hiring three QCs to lead the fight to clear their names.

Judge Jamie Tabor QC said DC Lewis failed to disclose 'game changing' evidence and made 'stark and very serious omissions'.

It emerged last month he is still working on serious crimes and has not been disciplined and James Martin's QC Edward Henry said the police officer had 'vandalised' the case.

Damning: Judge Jamie Tabor QC said Detective Constable Ben Lewis got too close to her and did not understand his job properly

The officer now faces an inquiry by Gloucestershire Police's professional standards department and could face disciplinary action.

Judge Tabor said that had Thady Duff, Leo Mahon and Patrick Foster, all 22, and James Martin, 20, been found guilty and this evidence later emerged he was certain the Court of Appeal would have found the convictions unsafe.

The four men had been accused of the gang rape of a young woman at an annual college ball at the Royal Agricultural University in Cirencester, Gloucestershire in May 2014.

She claimed she was subjected to violence, including strangulation, and some of it had been filmed and then sent by Mr Duff to his friends via Snapchat.

The trial was due to begin at Gloucester Crown Court in March but after delays due to the late disclosure of evidence and a review of the case, the prosecution offered no evidence and the four defendants were cleared.

Afterwards the defendants' barristers criticised Det Con Lewis for 'cherry picking' supportive evidence and 'airbrushing out of the picture' anything that could have helped the men.

This included text messages sent by the complainant in the hours after the alleged incident and a conversation with a friend about what would happen if the video became common knowledge.

The mobile telephone evidence was only recovered when experts instructed for the defence carried a full examination of the device.

It also emerged as the trial was due to begin that police failed to disclose that the complainant was a witness to an alleged rape on an army base in October 2014 and that there were inconsistencies in her evidence. The alleged rapist was a soldier but he was later cleared.

Three of the defendants, Mr Duff, Mr Mahon and Mr Foster, returned to court last month to apply for a proportion of their legal costs to be paid by the prosecution. Mr Martin received legal aid in the case.

The group were accused of raping the alleged victim at the end-of-year ball at the Royal Agricultural University in Cirencester, Gloucestershire (pictured)

Judge Tabor, The Recorder of Gloucester, granted the application and sent the case to a costs judge to determine the final figures payable.

He criticised DC Lewis for his shortcomings in examining the complainant's mobile phone and said he had a 'limited grasp of responsibilities' as disclosure officer.

THE WORLD-RENOWNED ROYAL AGRICULTURAL UNIVERSITY The University's annual Summer Ball is held in late May to mark end-of-year exams. The Royal Agricultural University is known as the 'Oxbridge of the Countryside' and the sons and daughters of many of Britain's biggest landowners are among its 1,200 students. The patron is Prince Charles and one of its former students is Captain Mark Phillips, former husband of Princess Anne. Around 1,200 students attend the RAU, which became the first agricultural college in the English-speaking world in 1845 when it was granted a Royal Charter by Queen Victoria. Former students include political commentator Jonathan Dimbleby, Princess Anne's ex-husband Captain Mark Phillips and the late champion horse trainer Sir Henry Cecil. Her descendants have always been Patrons of the institution which stands in a beautiful 25-acre campus on the edge of Cirencester, Gloucestershire. Since 2008, it has seen a 49 per cent rise in applications and is ranked top in the UK for investing in campus facilities. The internationally renowned university, which until 2013 was known as the Royal Agricultural College, is rated the Oxbridge of agricultural studies. Founded in 1845, it was the first agricultural college in the English-speaking world. Advertisement

'Aware as he was, not only of his duties, but the character of the complainant, Det Con Lewis should have investigated the download from the telephone in far greater detail than he did,' he said.

Three days before the trial was due to start, Det Con Lewis told the Crown Prosecution Service that 'nothing of relevance had emerged' from a search of the telephone.

'This was a truly startling state of affairs,' the judge said.

'Had not the applicants carried out a thorough investigation of the telephone a much skewed picture would have been presented to the jury.'

He also criticised the detective for getting too close to the complainant, failing to properly record his dealings with her, and for a lack of training.

'The lack of training for the role of disclosure officer and identifying too closely with the complainant very nearly led to the applicants conducting their trial with one hand tied behind their back,' he said.

'His omissions in relation to the disclosure of the telephone evidence were stark and very serious. His failure to adequately record meetings and conversations with the complainant was also a serious omission.

'If ever there was a case where the role of disclosure officer was separated from that of Officer in the Case, this was it.'

The judge also blasted the Crown Prosecution Service for failing to obtain from the Royal Military Police the files of the case in which the complainant was a witness.

'I appreciate that hindsight can make great sages of us all but the failure to check what Det Con Lewis had carried out with regard to the downloaded material, and more importantly to do nothing about the Royal Military Police file for months was stark and wrong.

'But for that short entry in Det Con Lewis's notebook of October 20 2014 the defence would not have known about this at all.

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

'I have no doubt that Det Con Lewis's conduct in relation to the failure to examine the downloaded material amounted to improper act or omission.

ROYAL AGRICULTURAL UNIVERSITY RAPE TRIAL: A TIMELINE OCTOBER 2013: Thady Duff was accused of a further sexual assault involving the same alleged victim, which allegedly took place in October 2013. MAY 2014: Leo Mahon, 22, Patrick Foster, 22, James Martin, 20, and Thady Duff, 22, had been accused of subjecting a woman to a rape ordeal on the night of the annual May Ball in 2014. JULY 2015: All four men were charged by the Crown Prosecution Service in July 2015. MARCH 29, 2016: A jury of six men and six women were sworn in on March 29 to hear the case but were discharged a week later not having heard any evidence. The group appeared at Gloucester Crown Court on March 29 to deny all charges against them. MARCH 30, 2016: Their trial had been due to start APRIL 2016: The case had been reviewed last week and a decision not to offer any evidence against the four defendants had been made. APRIL 11, 2016: All charges were dropped save for one of possession of extreme pornography against Mr Duff. Advertisement

'Other than the video clips, the prosecution's decision to offer no evidence was entirely as a result of the information uncovered by the defendants' investigation into the download of the complainant's telephone and their insistence that the Royal Military Police material be properly examined.

'The Crown Prosecution Service and Det Con Lewis must bear joint responsibility for the failure to properly disclose this game changing material.'

Mr Duff, of Blunsdon, Swindon; Mr Foster, of Colchester, Essex and Mr Mahon, of Cirencester, Gloucestershire were not present in court.

A police spokesman said the force took 'very seriously' the judge's findings.

'We accept the judge's findings and are now reviewing his comments in conjunction with the CPS to learn the lessons of this case and to improve how we investigate such cases,' he said.

'It is of course the case that although the judge has identified failings in relation to the disclosure process it is right to note that Det Con Lewis has not been found to have acted in bad faith in any way.

'Further the officer was available and willing to give evidence at the costs hearing but was never provided with any opportunity to do so to answer any of the allegations made against him.

'The force shall refer the judge's findings to the its professional standards department who shall consider whether or not any conduct issues have been identified in relation to any officers and these will be assessed in conjunction with the Independent Police Complaints Commission if necessary.

'Even if no misconduct is found to have occurred the performance of individual officers may still require scrutiny under relevant force procedures.'