Jailed SAS sniper Danny Nightingale has walked free from court after his sentence was suspended following a successful appeal.
Sergeant Nightingale was given 18 months military detention earlier this month after he admitted illegally possessing a Glock 9mm pistol and more than 300 rounds of ammunition.
Now judges at the Court Martial Appeal Court in London have cut the term to 12 months and said it should be suspended. They said he could be released immediately.
Speaking outside court, 37-year-old Sgt Nightingale thanked his wife and backers for their "trust and support".
The father-of-two also thanked the "great British public" and said he had been "humbled" by the reaction to his plight.
His wife Sally, 38, said she was "very, very happy" and "delighted".
Mrs Nightingale, who earlier wept at the judges' verdict, said: "We fought for this for the last three weeks and we got justice today and I thank everybody in that court and the public."
She went on: "It can only be good for all the troops out there fighting for our country to see justice has been done."
When asked if she would fight her husband's conviction, Mrs Nightingale said: "Yes, we are going all the way."
Judges heard that more than 100,000 people signed a petition calling for Sgt Nightingale to be released after his wife and other family members launched a campaign.
Wiping away tears, he hugged his wife and father Humphrey in the main hall of the building after walking free from the cells at the Royal Courts of Justice.
The sniper had admitted illegally possessing the gun and ammunition at a court martial and was sentenced by a judge sitting in a military court.
But three appeal judges - Lord Chief Justice Lord Judge, Mr Justice Fulford and Mr Justice Bean - said he should be released.
The judges were told the gun had been a gift from Iraqi special forces soldiers Sgt Nightingale had trained, and that he planned to have the weapon decommissioned and keep it as a trophy.
They also heard Sgt Nightingale, who has suffered medical problems affecting his memory, appeared to have put the gun in a cupboard in his army accommodation in Hereford on a "very hectic day" when preparing to deploy to Afghanistan.
The serviceman, whose accommodation was not on the SAS base at Hereford, said he had not "appreciated" that he had the weapon.
Lawyers representing Sgt Nightingale accepted he had admitted "serious offences" which crossed the "custody threshold" but they asked the appeal judges to "temper justice with mercy".
Lord Judge - the most senior judge in England and Wales - said the appeal panel had concluded the case involved an exceptional person and exceptional circumstances and that the sentence could be reduced.
Reacting to his release, Defence Secretary Philip Hammond said: "I am delighted for Sgt Nightingale and his family that he will be home not only before Christmas as they'd hoped, but by the end of November.
"The justice system has worked. I was pleased that an appeal was heard quickly and it is right that a court should decide on whether the sentence was appropriate. The Court of Appeal has decided the sentence was too harsh and has freed him."
Julian Brazier, MP for Canterbury and Whitstable, who has campaigned on behalf of Sgt Nightingale, also welcomed his release, saying: "I was delighted to hear the news."
He added: "While firearms offences are normally very serious, given the very unusual circumstances of the case, and Sgt Nightingale's remarkable record of service, the original sentence was a serious miscarriage of justice.
"I am delighted that Danny will be going home to his family for Christmas."