Court of Appeal judges have quashed the convictions of 39 sub-postmasters and postmistresses who claim they were wrongly convicted of stealing money from the Post Office.
The 39 - and hundreds of others who were also accused of taking money - claim the fault lay at the door of the Horizon computer system, which was installed in 1999. They said the system was flawed.
Between 2000 and 2014 the Post Office prosecuted 736 people based on information from the Horizon computer system, which was used for transactions and stocktaking.
The computer was made by Fuitsu, who have denied liability.
It was reported recently the British government - owners of Post Office Limited - could have to pay out £254 million in compensation to those who have been wrongly convicted.
Three of the 39 wrongly convicted have since died.
In their ruling the Court of Appeal judges said: “We conclude that 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.”
They added: "By representing Horizon as reliable, and refusing to countenance any suggestion to the contrary, Post Office Limited effectively sought to reverse the burden of proof: it treated what was no more than a shortfall shown by an unreliable accounting system as an incontrovertible loss, and proceeded as if it were for the accused to prove that no such loss had occurred."
They said the defendants were denied any disclosure of material capable of undermining the prosecution case and were therefore “inevitably unable to discharge that improper burden.”
The Court of Appeal ruled the convictions of three appellants - Neelam Hussain, Stanley Fell and Wendy Cousins - were safe because they did not rely on data from the Horizon system.
After the ruling Tim Parker, chairman of the Post Office, said: "The Post Office is extremely sorry for the impact on the lives of these postmasters and their families that was caused by historical failures."
One of those convicted, Jo Hamilton, told PA: "This is the biggest miscarriage of justice. I was 45 when this started. It's taken up nearly a third of my life. You think it's never going to end."
"I was given a 12-month supervision order and have a criminal record. But I did nothing wrong. I told them about the problem but they said I was the only one," added Ms Hamilton.
In December 2019 the Post Office agreed to settle out of court with 555 claimants for a total of £12 million.