An official at a Serco-run immigration centre justified leaking stories to The Sun by claiming the company turned a "blind eye" to corruption as colleagues drove around in Bentleys and Ferraris, a court heard.
Mark Blake is alleged to have conspired, while he was employed as a detention custody officer at Colnbrook secure immigration removal centre (pictured, Reuters), to commit misconduct with Sun journalist Tom Wells.
Their trial heard that between 2008 and 2010, Blake was paid nearly £8,000 for tips which resulted in ten stories in the tabloid newspaper.
As well as identifying individual detainees including a 9/11 plotter, stories highlighted cushy conditions under headlines such as "Wiis for foreign lags in UK jails", "Gastrojail" and "We fund massages for foreign killers", jurors were told
Prosecutor Jonathan Rees QC said that despite Blake receiving training about not talking to the press, when he was arrested in March 2013 he told police it was "all public interest".
Blake told them of violence between detainees and "widespread drug abuse", jurors were told.
Rees said: "He claimed that Serco were aware that officers were bringing in heavy drugs and that, consequently, some of the officers were driving Bentleys and Ferraris.
"In addition, he said that female officers were having sex with detainees. However, when officers were caught, Serco merely turned a blind eye and marched the officers off the premises."
Blake went on to tell police that he was told to "man up" and get on with his job even though he was obviously distressed about what was going on, and also told police that Serco would lavish detainees with things to keep them quiet to avoid paying fines if disorder broke out, the court heard.
He gave an example of an "Afghan rapist" who assaulted a female officer being given a new X-box to play with which was even replaced when he smashed it, while observing that he could not afford one for his daughter.
Against this background, Blake said he first contacted The Sun because he knew what was happening at Colnbrook was wrong and did not expect payment, the court heard.
But Rees said the prosecution did not accept Blake's assertion that he made a written or verbal complaint before going to The Sun about every single story.
Wells and Blake are on trial at the Old Bailey alongside two other Sun reporters and an ex-Daily Mirror reporter.
The court was told of another alleged conspiracy between Daily Mirror reporter Graham Brough and a prison officer at HMP Pentonville, who allegedly sold the newspaper stories about celebrity Jack Tweed being on suicide watch and pop star Boy George being so popular behind bars, other inmates were clamouring for his autograph.
Between January 2009 and January 2010, the officer, who cannot be named, received four payments from the Daily Mirror totalling £1,150, Rees said.
He said a custodial manager had reviewed the resulting articles and said the one about Tweed could increase the risk of him actually trying to kill himself.
Blake, 43, from Slough, ex-Mirror journalist Brough, 54, of south west London, Wells, 43, of south east London, Sun journalist Neil Millard, 33, of south Croydon, and a Sun reporter who cannot be named, all deny conspiring to commit misconduct, while Blake additionally denies misconduct in a public office.
Rees went on to outline other charges against the defendants.
One relates to Wells' contact with prison officer Richard Trunkfield, who allegedly sold information about James Bulger killer Jon Venables to The Sun between March and April 2010.
Wells and Millard were also allegedly conspiring with Scott Chapman, who worked at the prison where Venables was being held between March 2010 and March 2011, Rees told jurors.
The final charge relates to an alleged plot around November and December 2010 between Millard and Rosemary Collier, who worked as part of the civilian staff of the Metropolitan Police at the central communications command in Bow.
Rees told the jury that Collier had provided Millard with information about a mandatory briefing on how to act in the face of a terrorist shooting incident.
The details contributed to an article headlined "Mumbai raid fear on Xmas shoppers" and Collier was subsequently paid £700 in cash, the court heard.
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog