Bradford Crown Court heard yesterday how Amin, who had rented the ground- floor flat a few weeks before in a false name, was found sitting on a bed with drugs and other equipment, including cling film squares and electronic scales, on a table in front of him.

He told officers: "I'm stuffed when I'm caught bagging up."

Prosecutor Edward Bindloss described how officers seized heroin and crack cocaine worth about £500, but a further search of the flat uncovered more drugs and a loaded 8mm handgun with ammunition. Officers found 210 grams of heroin, worth an estimated £10,500 in the bedroom cupboard and discovered the handgun, with a total of 14 live rounds and two balaclava masks, in a meter cupboard near the front door.

Amin's DNA was matched to samples taken from the balaclavas, but he claimed that he had only tried one of them on.

The teenager, of Southfield Square, Manningham, pleaded guilty to charges of possessing heroin and crack cocaine with intent to supply and possessing the firearm without a certificate.

His barrister, Simon Anderson, stressed that although his client accepted being the manager of the operation at the flat for about five weeks, he was not one of the generals.

He said the teenager had not pleaded guilty to the offences involving the large amount of heroin and the handgun earlier because he did not fully appreciate the difference between ownership of items and acting as a custodian for others.

The court heard that Amin had no significant previous convictions and Mr Anderson said he had been recruited to pay off a £9,000 debt after he was caught driving a stolen car.

He explained that the vehicle had been confiscated as a result and those who had "hired" it to him eventually located him, bundled him into a car and pointed a firearm at him. Mr Anderson stressed that Amin had not made any direct profit from the drugs operation and described him as criminally nave.

Judge Robert Taylor said he had taken account of Amin's age and guilty pleas in reducing the total sentence, but he said for such serious matters the least sentence would be six years in a young offenders institution.

"It is said you were a foot soldier and those more criminally involved and more powerful were in charge and brought you into this operation by threatening you," he noted. "It is also said you never derived any direct financial benefit from the operation... that you were there to work off a debt that others claimed you owed.

Judge Taylor ordered the destruction of all the drugs seized and said the £255 found in Amin's possession at the time would be confiscated and given to the West Yorkshire police drugs fund.