You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
SAS Sergeant Danny Nightingale, 37, had admitted illegal possession of a Glock 9 mm pistol and ammunition at a court martial earlier this month.
But he maintained he was given the gun as a present in Iraq and, because of a brain injury, forgot about it.
An appeal against the sentence, led by his wife Sally, had attracted over 100,000 signatures and was backed by several newspapers and Prime Minister David Cameron.
"Thank you to the great British public," Sergeant Nightingale told reporters outside the Royal Courts of Justice after his release. "It's been an extremely humbling experience."
His tearful wife Sally added she had not dared "dream this would be the outcome."
"We got justice today," she said.
Lord Igor Judge ruled that while Nightingale had been found guilty of very serious offences, he was satisfied the special circumstances surrounding his military and medical history called for a lesser sentence.
His court martial was told the gun had been packed up and returned to Nightingale by colleagues after he had to leave Iraq in a hurry for the funeral of two friends killed in action, the Press Association reported.
The Court of Appeal heard how Nightingale had served in extremely testing conditions in Iraq, fighting the enemy every night and losing several colleagues in combat.
During his time in the SAS, he also put his medical and explosives training to good effect by pioneering a new field dressing based on an adhesive used to stick explosives to surfaces.
"He has, in my opinion, saved many lives," his former commanding officer, Lieutenant-Colonel Richard Williams, said in court.
The Appeal Court judges ruled Nightingale's sentence should be cut from 18 to 12 months and suspended. His conviction has not been not quashed, but his wife Sally said they intend to "fight it all the way."