Armed police were called to a Dunfermline house after a man appeared to have shot himself in the head in front of his partner.
The partner was not aware James McLaren owned the hand gun and started screaming when he put it in his mouth then fired it at his temple.
McLaren fell to the ground but recovered soon afterwards and the ‘weapon’ turned out to be a starting gun.
McLaren, 29, of Larch Grove, appeared for sentencing at Dunfermline Sheriff Court on Wednesday.
He admitted on May 30, at his home, he behaved in a threatening or abusive manner by placing a pistol in his mouth and to his head, pulling the trigger and repeatedly discharging the pistol.
He also admitted assaulting PC Andrew Adam by attempting to butt him.
Depute fiscal Dev Kapadia said McLaren’s partner began to become concerned after he had taken cocaine and alcohol then started feeling “very sorry for himself”.
“With the gun in his right hand, he put the end of the barrel to his temple and pulled the trigger,” continued Mr Kapadia.
His partner heard a loud bang which made ears ring and McLaren immediately fell to the ground.
When paramedics arrived they found the woman “in a very distressed state” and they then heard another loud bang.
When firearms officers arrived they found McLaren asleep in bed. He had a holster on with the gun in it.
Sheriff Craig McSherry said the gun “looks like a working weapon”.
He imposed a community payback order for 300 hours of unpaid work.