A sharp-eyed woman police uncovered a Taser when she examined an unusual-looking torch during a search of a burglar's flat.
The search was being carried out a Jordan Norman's home after an iPhone stolen in a burglary was traced to him.
Prosecutor Louis French told Luton crown court 25-year-old Norman was arrested by officers following the break-in of a Portacabin on 25 September last year.
The four burglars were masked, but Norman, who was wearing a motorcycle helmet, was identified from CCTV.
Officers went to his home on at 7.20 on 24 October last year.
"While a search was being carried out in the living room an officer noticed a torch on top of a tall set of drawers. It had a switch that did not look right to the officer. She looking closer and saw it was a taser disguised as a torch," said Mr French.
Norman told the officer: "I bought it online."
Norman, who lives at The Old Furlong in Cranfield, appeared for sentence having admitted possessing a disguised firearm and conspiring with three other to commit burglary.
In a basis of plea he admitted one burglary.
Defending, Brad Lawlor said there was nothing to charge the stun gun found at the flat. He said the burglary was not a sophisticated offence.
He asked the judge to pass an exceptional suspended sentence because of the mental health problems that Norman suffers.
The court heard the unemployed father of two was in a weak state of mind at the time of the offences and was vulnerable.
Judge Andrew Bright QC agreed saying Norman needed: "support, assistance and psychological intervention."
He passed an 18 month sentence suspended for two years with condition that Norman has mental health treatment and 15 days of a rehabilitation activity. He must also pay £500 prosecution costs from his benefits at the rate of £5 a week.