Customs officials engaged in the war against heroin during the 1990s were so "out of control" that they contributed to and funded the international trade in the drug, it was claimed yesterday.
Defence lawyer James Wood QC told the court of appeal: "Customs and Excise themselves imported vast quantities of heroin into the UK under the system of socalled 'controlled deliveries'.
"On occasions, significant quantities of that heroin were permitted to be distributed on to UK streets.
"Such rewards were paid to participating informants that the international trade in heroin was, in part, funded.
"All the while, the courts of the UK, and the authorities in Pakistan, were kept in ignorance of the true role which officers of Customs and Excise and participating informants were playing in these importations."
Mr Wood was appearing for one of five men whose convictions of dealing in heroin are due to be quashed because of the failure of Customs to disclose crucial evidence which could have resulted in their acquittal at trial.
Four of the men - two from Manchester and one each from Birmingham and Bradford - have served their jail terms, and a London man was granted bail last year pending appeal.
They all say they were wrongly accused on the basis of information from paid informants whose rewards from the C&E were often so great that they were prepared to "set up" innocent people by identifying them as the intended recipients of drugs imported into the UK.
The Crown has indicated it will not resist the appeals, and the court has said the convictions - relating to drugs worth £7 million - must be quashed.
But the appeal judges - Lord Justice Hooper, Mr Justice Roderick Evans and Mr Justice Pitchers - are hearing three days of legal submissions over the extent of Customs officers' involvement.
Mohammed Ashraf Choudhery, 60, of Couver Quasy, Salford Quays, Salford, and his son, Mohammed Warris Ashraf, 37, of Cenderbrook Drive, Cheadle, Stockport, were jailed for 14 and 12 years respectively at Manchester Crown Court in 1997.
Sadaat Maqsood Ahmed, 49, of Conway Road, Ealing, west London, was jailed for 20 years at Harrow Crown Court in 1997. He was granted bail last May pending the outcome of his appeal.
Hussain Shah, 51, whose family lived in Bradford and had grocery shops in the city as well as in Leeds and Huddersfield, was jailed for four years at York Crown Court in 1997.
Jameel Akhtar, 35, was jailed for 13 years in 1997 at Birmingham Crown Court.
All were convicted of being involved in the importation of heroin.
Two of the cases were referred to the Court of Appeal by the Criminal Cases Review Commission, which is believed to be examining up to 12 other convictions involving " controlled" drug deliveries.
The hearing continues.