Undercover police officers disrupted an alleged crime gang supplying heroin in Tyrone the High Court heard on Tuesday.
Five suspects, all Portuguese nationals, were arrested following a covert operation involving audio and video recordings, prosecutors disclosed.
Details emerged as bail was refused to one of the men accused of being part of the team.
Carlos Rolo faces charges of possessing and supplying Class A drugs.
The 48-year-old, of Molesworth Street, Cookstown, told police he used heroin in the past but denied the alleged offences.
It was claimed, however, that he passed a £20 bag of the drug to an officer near his home address in May.
Prosecution barrister Conor Maguire said: “The applicant, police say, is part of a five-person crime gang. They are all Portuguese nationals.
“The evidence against each of the accused is that over a period of time, and as a result of a proactive police investigation, each of them was seen to supply drugs to undercover police offices.”
The court heard officers posing as drug buyers would contact one suspect who would then put them through to others at different stages in the operation.
“In respect of each of them there is audio and video evidence,” Mr Maguire added.
“It’s the police view that Mr Rolo has been acting as part of a criminal gang in the Cookstown and Dungannon areas.”
The accused, who has been living in Northern Ireland for 14 years, was seeking bail to live at a Simon Community hostel in Larne, County Antrim.
His barrister stressed: “The applicant does not accept involvement in that gang.”
Bail was refused, however, after the judge identified a risk of re-offending.
Mr Justice Treacy said: “I’m quite satisfied because he is alleged to be a member of a criminal gang.”