A man who told police he had a home-made gun at his farm in Aberdeenshire has been jailed for two years.
Raymond Panton, 54, was earlier convicted of possessing two improvised shotguns, without authority at Parkhill Stores, Greens, New Deer.
Ian Robertson, 40, also of New Deer, was acquitted following a trial.
The minimum sentence for possessing prohibited firearms is five years unless there are exceptional circumstances.
At the High Court in Edinburgh, Panton's defence counsel David Moggach argued that this was such a case where it was open to the judge to make such a finding.
Lord Bannatyne said the case was "incredibly odd" and that he found exceptional circumstances were established.
The offences were committed between April 4 and August 15 in 2014.
He claimed to police that he had discovered two metal tubes in a bedroom at the farm and after looking at them realised that if slotted together shotgun cartridges could be fired.
Mr Moggach said Panton had phoned the police and co-operated as to where they might find a second weapon.
The defence counsel said: "This is a case where there are most unusual and exceptional circumstances pertaining to the facts and circumstances of the case."
He said there was no evidence of the firearm being used or intended to be used in "a criminal context".
"There were two improvised, home-made firearms found in the property that he owned, although he did not always stay there," he said.
Mr Moggach said Panton had struggled with "mental health issues" but had been assessed as currently posing a low risk.
Lord Bannatyne said: "This all resulted from him bringing the police to his house and showing them the gun. If, for no other reason, the case was incredibly odd."