A detective put four men through a 'living hell' when they were wrongly accused of gang rape after he cherry picked and airbrushed evidence that could have helped, a court has heard.

Detective Constable Ben Lewis, of Gloucestershire Police was accused of 'stark errors' in his handling of the investigation into Thady Duff, Leo Mahon and Patrick Foster, all 22, and James Martin, 20.

They were accused of gang raping a young woman at a ball at the Royal Agricultural University in Cirencester, Gloucestershire in May 2014.

Thady Duff, left, and Leo Mahon, right, who were cleared of gang raping a young woman at the Royal Agricultural University and are now asking for the CPS to pay their legal costs

The complainant alleged she had been raped and subjected to violence, including strangulation, and some of it had been filmed and shared for others to watch.

The trial had been due to begin at Gloucester Crown Court last month but following 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.

Now three of the men Mr Duff from Blunsdon, Swindon, Mr Mahon of Cirencester and Mr Foster from Colchester, have returned to court to apply for a proportion of their legal costs to be paid by the prosecution.

They have been left with large legal bills after hiring three QCs to lead the fight to clear their names.

And today a senior barrister criticised the police and in particular Detective Constable Ben Lewis, accusing of 'cherry picking' supportive evidence and 'airbrushing out of the picture' anything that could have helped the four 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.

Fellow students Patrick Foster, left and James Martin, right, were also accused of rape but were cleared when the prosecution could offer no evidence

It 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 there were inconsistencies in her evidence. The accused was a soldier and he was cleared at a court martial.

Eleanor Laws QC, representing the three applicants, criticised police for not fully downloading data from the complainant’s mobile phone, which was only done by an expert instructed by the defence after the trial had been due to start.

She told Judge Jamie Tabor QC that text messages sent after the alleged incident undermined the prosecution case as the complainant discussed 'mundane things.'

She also said it had been 'unadvisable' for Detective Constable Lewis to take on the dual roles of investigator and disclosure officer, which Judge Tabor noted would be 'unthinkable' in a major inquiry.

The complainant alleged she had been raped and subjected to violence, including strangulation, and some of it had been filmed and shared for others to watch at a ball at the Royal Agricultural University, pictured

Miss Laws added: 'If the level of contact that took place between the complainant and the officer in the case was highly unusual, it was not against the rules.

'In my experience it is unusual. He was feeding the complainant information she should not have had.

'He must have realised there was a real danger of cross-contamination because he was discussing with her that she should talk to other witnesses about giving statements.

'In the end there was one witness who came very close to supporting what she said happened - and she was very close to the complainant.

'He failed to disclose matters that undermined the complainant’s credibility. He failed to disclose material that undermined the prosecution case and assist the defence.

'This material taken together was so significant that in my submission there have been clearly stark errors in relation to matters that were taken into account in offering no evidence.'

Miss Laws then expalined that the decision to end the prosecution against the men should have been taken 'a long time ago'.

She explained: 'There have been a series of stark errors in relation to the telephone and the Royal Military Police material and there are four young men whose lives have been on hold.

A trial had been due to begin at Gloucester Crown Court, pictured, last month but following 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

'It has been a living hell. It would have been a complete travesty. They are all innocent men.

'They showed the video of a consensual incident and of course we know that happened in relation to the complainant and another man and she got upset by it and he wasn’t waiting two years for a trial.

'Yes, their behaviour is bad in showing what they thought was consensual but no-one suggests they deserved what followed.

'It was a false allegation that remained for two years without proper scrutiny from the officer in the case.'

She said Mr Duff, Mr Foster and Mr Mahon, had been suspended by the university as soon as the allegations were made and their studies remained on hold.

Fiona Elder, for the prosecution, said the decision to offer no evidence was for 'cumulative reasons' and a result of lack of disclosure or further disclosure or of 'bad faith' on the part of the police.