A grandmother has been spared a five-year jail sentence for keeping a World War II heirloom gun in her home.
Gail Cochrane, 53, from Dundee, had kept the pistol for 29 years following the death of her father, who had been in the Royal Navy.
She was jailed for five years in June, but appealed against her sentence.
Judges at the Court of Criminal Appeal in Edinburgh were split over Cochrane's case, but on a majority decision ruled that her prison term should be quashed.
They ordered her to carry out 240 hours community service.
Following the ruling, Cochrane said she was relieved the case was over and added: "It has been a nightmare."
The grandmother-of-six, who spent six weeks in prison before being freed pending her appeal, said: "It was just devastating. I will never, ever do anything like that again. It has actually ruined my life."
She added: "When I got five years I was just like - five years - I haven't done anything wrong. It was a war trophy. I didn't have bullets or anything."
Cochrane was originally jailed for the minimum term for illegal possession of a firearm after police found the unlicensed military pistol during a search at her home in Dundee.
The judge, Lady Smith, said she was not satisfied that it was one of the rare cases where it could be shown that exceptional circumstances existed.
When these circumstances exist, the minimum jail term does not have to be imposed.
But defence lawyers challenged the decision, arguing that the sentencing judge had erred in ruling that exceptional circumstances did not exist.
Her case initially divided the two appeal judges who heard it, Lord Clarke and Lord Hardie, and it was referred to a bench of three judges.
Lord Reed said it was "a difficult and anxious case" but added: "I have come to the conclusion that it is appropriate to interfere with the decision of the sentencing judge in this case."
He said that when Cochrane's personal circumstances were taken into account it appeared that the imposition of five years imprisonment in her case would be "arbitrary and disproportionate".
"Bearing in mind the appellant's early plea of guilty, the low risk of re-offending and her personal circumstances, it appears to me that this is a case which could appropriately be dealt with by an order for community service," he said.