A detective will not face misconduct proceedings over the collapse of a trial of four men accused of the gang rape of a woman at a leading university.

The Independent Police Complaints Commission (IPCC) said investigators had found no evidence to support "a case to answer conclusion" against Detective Constable Ben Lewis, of Gloucestershire Police.

Thady Duff, Leo Mahon and Patrick Foster, all 23, and James Martin, 21, were accused of raping the woman at a summer ball at the Royal Agricultural University in Cirencester, Gloucestershire, in May 2014.

She claimed she had been subjected to violence, including strangulation, and some of it had been filmed and posted on Snapchat.

The trial at Gloucester Crown Court collapsed last year due to the late disclosure of evidence and a review of the case.

After the four men had been cleared, Mr Lewis, who was the lead officer, was criticised by judge Jamie Tabor, The Recorder of Gloucester.

The judge said the officer had got too close to the complainant and did not understand his job properly, which led to "stark and very serious omissions" by Mr Lewis in failing to disclose "game-changing" evidence.

The defendants' barristers criticised Mr Lewis for "cherry-picking" supportive evidence and "airbrushing out of the picture" anything that could have helped their clients.

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 by the defence carried out a full examination of the device.

It also emerged as the trial was due to begin that police had failed to disclose 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.

The IPCC launched an investigation into Mr Lewis after the trial was halted in March 2016.

The watchdog said the officer had no case to answer for misconduct in relation to the allegations, which included that he failed to comply with procedures relating to the disclosure of evidence, that his record keeping was inadequate, and that he had inappropriate contact with the complainant during the investigation.

A supervising officer whose actions relating to the supervision of Mr Lewis were also investigated, also has no case to answer.

During the course of the investigation evidence was found that indicated Mr Lewis may have inappropriately disclosed detail about material found on a defendant's phone to the complainant.

The watchdog said these actions could amount to unsatisfactory performance and Gloucestershire Police will deal with the matter through management action.

IPCC associate commissioner Guido Liguori said: "A number of concerns were rightly raised when the trial collapsed, however our thorough investigation into the actions of the officers involved and the manner in which the investigation was conducted has identified no individual failings that could lead to misconduct proceedings.

"We have established that despite the criticism which arose following the trial collapse, the evidence shows that Det Con Ben Lewis did what was asked of him by the CPS, and acted in accordance with relevant policies and procedures.

"Wider recommendations for learning have been made to Gloucestershire Police, which they have accepted, that will hopefully prevent some of the systemic issues identified as part of the criminal investigation from occurring again."

Detective Superintendent Simon Atkinson said: "Gloucestershire Police regrets the case collapsed at trial but welcomes the IPCC's investigation report which exonerated Det Con Lewis following a very thorough investigation.

"What this case did highlight was the challenges investigators face when dealing with huge amounts of data stored on phones and other electronic devices.

"We have now issued further guidance to officers and have improved the way in which we review electronically stored data."