Four high-profile former members of the SAS have joined the battle to free a special forces sniper jailed for possessing a firearm, claiming he is victim of a "travesty of justice" and a "shameful betrayal".

In an open letter to David Cameron, Lieutenant Colonel Richard Williams, Colonel Tim Collins, Andy McNab and Chris Ryan demanded immediate action, saying: "Compare this man's case to that of Abu Qatada and see if it is fair."

Sergeant Danny Nightingale's case has been compared to that of Abu Qatada

Sergeant Danny Nightingale, who served in Iraq and Afghanistan, was sentenced to 18 months in military detention by a court martial last week.

He was charged with illegally possessing a 9mm Glock pistol which had been packed up and returned to him by colleagues after he had to leave Iraq in a hurry to help organise the funeral of two friends killed in action.

The gun was a gift from Iraqi soldiers he had been helping to train in 2009 and he claimed he did not remember having it.

Sgt Nightingale had been planning to fight the charge but pleaded guilty after being warned he faced a five-year sentence.

The case has sparked outrage, with Sgt Nightingale's family, fellow soldiers and some politicians dubbing it a betrayal of a war hero.

Today the four former special forces heroes wrote an open letter - published in The Sun - to the Prime Minister, calling for the father-of-two to be released on licence and the case reviewed.

Lt Col Williams, former commanding officer of 22 SAS and Sgt Nightingale's commanding officer in Iraq, and the other three men said Sgt Nightingale was "the victim of a monstrous miscarriage of justice".

"This shameful betrayal ruins 17 years of exemplary service - including 11 with the SAS," they wrote.

"We say this prosecution should never have happened. Furthermore, we say he was bullied into a guilty plea. And lastly, we say the custodial sentence is completely disproportionate to the alleged crime.

"We say he is the victim of a shameful travesty of justice and we demand immediate action.

"Compare this man's case to that fo Abu Qatada and see if it is fair."

They urged Mr Cameron to "exercise leadership and judgment" and release Sgt Nightingale on licence so the case can be reviewed.