A grandmother who was forced to remortgage her house after being accused of stealing £36,000 has been cleared of wrongdoing after the Court of Appeal ruled the Post Office’s case against her was riddled with “pervasive failures”.

Josephine ‘Jo’ Hamilton was among 39 sub-postmasters whose conviction for false accounting was overturned following evidence based on an ‘error-prone’ system being quashed.

The 63-year-old had pleaded guilty in 2008 to avoid prison, and was forced to pay back the thousands the post office claimed she owed.

“I think this is the biggest miscarriage of justice,” she said.

“You think of the Birmingham Six and the Guildford Four – but there are hundreds of us.

“I was 45 when this started. It’s taken up nearly a third of my life. You think it’s never going to end.”

The chairman of the Post Office apologised, and said the organisation had made reforms to prevent these events repeating.

The heart of the case focuses on the Horizon system, which was used for accounting and stocktaking at post offices across the country from 1999. However, it had a tendency to produce “inexplicable discrepancies” in the accounts, data which was used to prosecute staff across the country.

However, the Court of Appeal today ruled that the Post Office “knew that there were serious issues about the reliability of Horizon” but had made no attempt to investigate the claims of staff like Jo.

In her case, the former sub-postmistress of South Warnborough first noticed problems in 2003 when her till system showed there was £2,000 missing.

Jo contacted Post Office support who advised her how to resolve the issue. However, after following their instructions, the discrepancy doubled to £4,000.

"I panicked and altered the figures in the system,” she said. “This eventually led to a missing amount of £36,000.”

She added: "I was officially summoned in 2006 and entered a plea bargain with the Post Office. I pleaded guilty to false accounting in 2008 because I was afraid of going to jail.

"I had to remortgage my house to pay back the missing money. My mum and dad also helped me with the funding as well. I have a criminal record now, I was sacked from the Post Office and I’m now working as a cleaner."

Today (April 23), she was vindicated by judges in the Court of Appeal following a hard-fought legal battle.

In a written ruling, Lord Justice Holroyde said: ““POL [Post Office Limited] knew that subpostmasters around the country had complained of inexplicable discrepancies in the accounts.

“POL knew that different bugs, defects and errors had been detected well beyond anything which might be regarded as a period of initial teething problems.

“In short, POL knew that there were serious issues about the reliability of Horizon.”

He continued: “Throughout the period covered by these prosecutions POL’s approach to investigation and disclosure was influenced by what was in the interests of POL, rather than by what the law required.”

The court quashed 39 convictions, saying they were “an affront to the conscience of the court”.

In a statement after the ruling, Post Office chairman Tim Parker 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.

“Post Office stopped prosecutions soon after its separation from Royal Mail a decade ago and has throughout this appeals process supported the overturning of the vast majority of convictions.

“We are contacting other postmasters and Post Office workers with criminal convictions from past private Post Office prosecutions that may be affected, to assist them to appeal should they wish.

“Post Office continues to reform its operations and culture to ensure such events can never happen again.”