A father-of-two was jailed for more than five years after he was caught with a gun during a drugs raid at his home.
John Clark told police after he was detained: “I ken you won’t believe it, but I just got they things in the flat.”
A judge told Clark he had admitted being concerned in the supply of a Class A drug and a “very serious” firearms charge.
Lord Boyd of Duncansby said: “I accept your involvement in this matter is at the lower end of the scale, having agreed to hold these items for another person.”
The judge imposed a total sentence of five years and two months on Clark for the offences.
Advocate depute Duncan McPhie earlier told the High Court in Edinburgh on Tuesday that officers had received intelligence that Clark was dealing heroin from his home in Macbeth Moir Road, Musselburgh, in East Lothian.
A search of the premises found bags of heroin, a digital scales box and a revolver inside a bag and towel.
Clark, 26, admitted being concerned in the supply of heroin on March 24 and possessing the illegal gun.