Paul Clarke, from Surrey, was previously convicted by a jury of possession of the gun, which he said he had found in a bag in his garden.
Mr Clarke had faced the prospect of a five-year prison term when he was sentenced.
Judge Christopher Critchlow explained that Mr Clarke should have asked police to come immediately, rather than waiting for four days.
He said: ?I understand you were once a soldier, and you in particular ought to have appreciated the danger posed by such a weapon and should have asked the police to come to collect it right away.?