Judges have quashed Thomas TC Campbell and Joe Steele's convictions for the so-called Ice Cream Wars murders 20 years ago.
Steele and Campbell had always protested their innocence
Three judges at the Court of Criminal Appeal in Edinburgh decided they were victims of a miscarriage of justice.
They had been convicted of murdering six members of the Doyle family at their Glasgow home in a turf war over areas served by ice cream vans.
The men always pleaded innocence and this was their third appeal.
There was a burst of applause from Mr Campbell and Mr Steele's supporters in the public gallery as the ruling was given.
Lord Gill, sitting with Lords MacLean and Macfadyan, told the men: "Your convictions are quashed and you are free to go."
However, outside the court, Mr Campbell said there was no celebration.
He said: "It's been difficult to get here and there is no jubilation, there's no happiness because I feel there are only losers in this case.
"Everybody has lost. The Doyles have lost their family, we've lost our lives in prison and for 20 years justice has lost.
"And the people of Scotland have lost the justice system."
In a statement read outside the court, Mr Campbell's solicitor, Aamer Anwar, said: "After 20 years of hunger strikes, prison breakouts, demonstrations, political pressure, solitary isolation, prison beatings, legal fight after legal fight, TC Campbell and Joe Steele are finally free from a life sentence.
"The term used to describe this case will be miscarriage of justice but it was more than that, it was a malicious prosecution by Strathclyde Police.
"At the heart of this case was allegations of police corruption, officers of the law who conspired for nearly 20 years to keep these men behind bars."
Mr Anwar demanded a "full independent inquiry" into the men's case and a reopening of the murder investigation. He said law officers must explain why it took so long to accept the men's innocence.
The appeal judges quashed the convictions because of new evidence and because they said there had been significant misdirection of the jury by the judge at the original trial.
The latest hearing followed the intervention of the Scottish Criminal Cases Review Commission, which was set up to assess alleged miscarriages of justice.
Both men had been serving life sentences for the murder of six members of the Doyle family, including a baby, after a fire attack on their home in Ruchazie, Glasgow, in April 1984.
The deaths coincided with the targeting of ice cream vans in Glasgow as a front for moving stolen goods and drugs.
New evidence was brought to the latest hearing by Professor Brian Clifford, which questioned police testimony given at the trial.
The professor of cognitive psychology said the recollection of police officers at the time of the murders was "too exact."
Six members of the Doyle family died as fire ripped through their home
He was referring to a sentence taken down by four officers in their notebooks which was allegedly said by Mr Campbell.
The appeal, which ran from 17-25 February, heard that police told the court Campbell said: "I only wanted the van windows shot up. The fire at fat boy's was only meant to be a frightener which went too far."
Prof Clifford said his studies "strongly suggested that it was not at all likely" that the officers would be able to note the statement "in such similar terms".
Reading a summary of their findings, Lord Gill said: "Our conclusion is that any jury hearing Prof Clifford's evidence would have assessed the evidence of the arresting police officers in an entirely different light.
"The evidence of Prof Clifford is of such significance that the verdicts of the jury, having been returned in ignorance of it, must be regarded as miscarriages of justice."
Lord Gill added: "Prof Clifford's evidence is uncontradicted by the Crown."
A spokesman for Strathclyde Police said: "We note the decision of the court and will consider the written judgement in detail before making any further comment."
The Scottish Executive said it would also study the written judgement before considering requests for an independent inquiry and compensation.