A man tried to hold a door shut while police raided a flat, finding almost £200,000 of drugs and a rifle.
William Wilson tried to stop officers who forced down a door to discover a gun and bullets in a flat on Gartloch Road in Glasgow.
A Winchester rifle and five live bullets were found in a cupboard next to the front door.
Heroin worth £134,000 and cannabis worth more than £53,000 was also discovered in the raid.
Items used to mix and cut drugs were found in the kitchen along with more than half a kilo of heroin and quantities of caffeine and paracetamol.
A further 19kg of cannabis was also recovered. Most of the drugs were inside heat-sealed packages.
The 37-year-old, who was at the flat with its occupier, was jailed for five years on Monday.
He said: "All the stuff in here is mine. I just use him. I pay him in green."
Police carried out a further raid on a flat on Rigby Drive, Glasgow, on the same day and found a further 2kg of heroin wrapped in seven brown taped packages.
'All the stuff in here is mine. I just use him. I pay him in green.'William Wilson
Wilson earlier admitted being concerned in the supply of both heroin and cannabis on August 9.
He also pleaded guilty to illegally possessing the gun and ammunition.
He had previously been sentenced to more than three years' imprisonment.
A judge told Wilson, a prisoner at Barlinnie, that he would have been jailed for seven and a half years for the latest offences if it was not for his guilty pleas.
Lady Scott said: "You are assessed as presenting a high risk of reoffending."
Defence solicitor advocate Brian Gilfedder said Wilson had a job following his earlier release from prison but had broken his ankle.
Wilson then agreed to look after "a safe house" for drugs in return for £500.
The Crown has raised proceedings to seize any crime profits from Wilson.
The court was also told it was making an application for a serious crime prevention order against him which can limit access to phones and computers and require financial details.