A former prison officer has pleaded guilty to helping inmates smuggle drugs into a private prison in Warwickshire.
Judge Richard Bray described the conspiracy as "serious"
Gordon Hacker, from Rugby, conspired with inmates serving at HMP Rye Hill between November 2004 and April 2005, Northampton Crown Court heard.
Hacker, 44, tipped off inmates about the best times for accomplices to throw drugs into the prison over the prison wall, the court was told.
He was remanded on conditional bail and is due to be sentenced in December.
Hacker, 44, was charged along with four co-defendants, all of whom had already pleaded guilty to conspiracy to supply controlled drugs at Rye Hill.
They are Stephen McClusky and Thomas Zealand, who were inmates at Rye Hill at the time of the conspiracy, and Sheree Williams and Stephanie Zealand, the two men's girlfriends.
They are all also due to be sentenced in December.
Judge Richard Bray, presiding, described the elaborate drug-trafficking conspiracy at Rye Hill.
He told the court: "It consisted of using moneys that had been earned in prison through prison work, or moneys used by relatives of inmates in prison to fund a bank account used by one of the girlfriends of the prisoners."
Drugs were then bought with the money on the outside and thrown over the prison walls at night to inmates who were waiting on the inside, the court heard.
Judge Bray told the court Hacker's involvement was "by telling them when was a good time to throw stuff over the wall, and doubtless turning a blind eye to what was going on".
Telephone records revealed that Hacker had received frequent and regular telephone calls over the four-month period from 2004 to 2005 from Stephen McClusky and Thomas Zealand.
Rachel Brand QC, prosecuting, told the court: "Sometimes he was being called by these men several times, many times, in the course of one day."
Ms Brand told the court that although the calls often lasted no more than a few seconds, it was "enough, I suppose, for someone to say I need to speak to you, come and see me".
Ecstasy, cannabis, heroin
There was insufficient evidence to prove whether Hacker had actually brought drugs into the prison himself, or whether he realised the scale of the trafficking, the court was told.
But payments ranging from £20 to more than £800 were made into the bank account being used for the conspiracy.
The payments to the account held by Sheree Williams amounted to £6,390; and large quantities of drugs were found at the homes of Sheree Williams and Stephanie Zealand, the court was told.
The drugs included cannabis resin, ecstasy pills, diamorphine and heroin, the prosecution said.
Speaking outside the court, Det Sgt Andy Blaize of Northamptonshire Police, said postal orders were sent from "numerous" prisoners to addresses across Coventry.
He said: "When you look at these addresses, there is some link with an inmate, and Stephanie Zealand has gone to collect the majority of these postal orders."
Judge Bray said: "As to the scale of all this, we're not talking about the odd throw over the prison walls here. This is serious stuff."
In 2005, a report by the chief inspector of prisons found HMP Rye Hill to be "unsafe for staff and inmates alike".
The report of the inspection was described by the Prison Reform Trust as "one of the most damning we have ever seen".