A garda suffered an electric shock when a torch in a man's car turned out to be a disguised stun gun.
Jankauskas Regimantas (21) did not warn the garda about the device when he tried to turn it on during a search of the vehicle.
Father-of-one Regimantas was a delivery driver and had the weapon for his own protection after his brother was "jumped on".
Judge Anthony Halpin put the accused on a bond to keep the peace and be of good behaviour for a year.
Regimantas, of Lindisfarne Grove, Clondalkin, pleaded guilty to unlawful possession of the stun gun.
Dublin District Court heard the incident happened at 10.30pm last April 14.
Gardai saw the accused's car on the forecourt of a service station on Clontarf Road.
Acting on suspicions, they searched the vehicle.
No drugs were found, but an officer found what appeared to be a torch in the side pocket of the driver's door.
While trying to switch on the 'torch', the garda received an electric shock to his hand.
On further examination, he established it was a stun gun disguised to look like a torch.
The accused had failed to inform the garda of this while he was looking at it.
After the officer received the shock, the defendant admitted the stun gun belonged to him and said he had it for his own protection while working on his rounds.
The accused had no previous convictions.
Regimantas was originally from Lithuania and had been living in Ireland since the age of eight, said his solicitor, Paula Egan.
His mother was in court to support him.
Since leaving school in 2011 he had a good employment record, having worked in hotels and at a recycling company.
He was now looking for other work and was in receipt of Job seeker's Allowance.
He was anxious to get work but the available employment was limited, Ms Egan said.
"He had it for his own protection. He has a brother who is also a delivery driver who was jumped on by individuals at the time," she added.
Judge Halpin said: "It should be sent to Garda Headquarters - they have a museum there."