Subpostmasters' lives were "irreparably ruined" as they lost their jobs, homes and marriages after they were prosecuted by the Post Office - which knew the Fujitsu-developed IT system had "faults and bugs from the earliest days of its operation", the Court of Appeal heard last month.
Lawyers representing 42 former subpostmasters - including Alison Hall from Liversedge in West Yorkshire and Janet Skinner from Hull - said evidence of serious defects in the Horizon system was "concealed from the courts, prosecutors and defence", in order to protect the Post Office "at all costs".
Their convictions were referred to the court by the Criminal Cases Review Commission (CCRC) last year following a landmark High Court case against the Post Office.
The Post Office conceded that 39 of the 42 former subpostmasters should have their convictions overturned on the basis that "they did not or could not have a fair trial".
But it opposed 35 of those 39 cases on a second ground of appeal, which is that the prosecutions were "an affront to the public conscience".
At the Royal Courts of Justice in London on Friday, 39 of the former subpostmasters finally had their names cleared.
Announcing the court's ruling, Lord Justice Holroyde said the Post Office "knew there were serious issues about the reliability of Horizon" and had a "clear duty to investigate" the system's defects.
But the Post Office "consistently asserted that Horizon was robust and reliable" and "effectively steamrolled over any subpostmaster who sought to challenge its accuracy", the judge added.
The Court of Appeal also allowed the appeals on the basis that their prosecutions were an affront to justice.
Lord Justice Holroyde, sitting with Mr Justice Picken and Mrs Justice Farbey, said: "Post Office Limited's failures of investigation and disclosure were so egregious as to make the prosecution of any of the 'Horizon cases' an affront to the conscience of the court."
However, three of the former subpostmasters - Wendy Cousins, Stanley Fell and Neelam Hussain - had their appeals dismissed by the court.
Lord Justice Holroyde said the Court of Appeal had concluded that, in those three cases, "the reliability of Horizon data was not essential to the prosecution case and that the convictions are safe".
In a statement, Neil Hudgell from Hull-based Hudgell Solicitors, who represented 29 of the former subpostmasters, said: "It is almost impossible to describe the true impact that this scandal has had on the lives of this group of people who had their reputations and livelihoods so unfairly destroyed.
"They are honest, hard-working people who served their communities but have had to live with the stigma of being branded criminals for many years, all the while knowing they have been innocent."
He added: "The court heard shocking evidence with regard to the Post Office and how it destroyed innocent people.
"Indeed, given its actions, everything the Post Office has sought to do over the last year or so, whether it be by way of apology and offers of redress, or by talking about a cultural change, completely unravelled when our clients' cases where heard.
"The Post Office failed to offer any sort of explanation as to why wholesale disclosure of evidence was withheld in cases, nor why a proper investigation was not carried out when known problems in the Horizon system started to appear.
"Instead they sought to attribute failings to incompetence and not bad faith, and to engage in legal gymnastics to seek to persuade the court away from finding a clear systemic abuse of process of the criminal law."