Craig Murray, the former British ambassador to Uzbekistan, left HMP Edinburgh on Tuesday to the cheers of about 100 supporters who had arrived to see him walk free at the end of his prison term.
“It’s been a hard four months,” he said.
"I’ve learned a lot. One thing I have learned is that dignity comes from inside.
“Nobody can take away dignity from you if you don’t allow them to do so and those in the Scottish establishment who attempted to humiliate and degrade me only succeeded in humiliating themselves and sadly in bringing shame on Scotland internationally” he said.
Mr Murray, who had become a blogger and pro-independence campaigner in recent years, was judged to have been in contempt of court over blogs he wrote during the trial of former first minister, Mr Salmond.
The 63-year-old’s offending articles contained details which, if pieced together, could lead readers to identify women who made allegations against Mr Salmond, who was acquitted of all 13 charges including sexual assault and attempted rape in March last year.
On August 1, Mr Murray handed himself into police in Edinburgh and began his jail term.
Leaving the Stenhouse prison, he said it was “horrible in there” and “prison is not a pleasant place”.
Mr Murray added: “Scotland should be ashamed of his antiquated, old fashioned and retrograde justice system”.
Almost breaking down in tears, Mr Murray thanked his wife Nadira and his children, who were at the prison to see him released, and his supporters.
He said he had thousands of letters from across the world, including ones which said they were “appalled at this attack on freedom of speech and this miscarriage of justice”.
In his 16-minute speech, the former ambassador welcomed the Republic of Barbados into existence after it had “shaken off the British monarchy”, and attacked Nicola Sturgeon and the SNP for not making a “scintilla more progress than they have on the day I went in”.
And Mr Murray said the prison guards he encountered in HMP Edinburgh said to him they did not think he should be in jail.