Image copyright Jo Hamilton

Jo Hamilton is celebrating "one of the best days I've ever had".

Her life was turned inside out after the sub-postmistress was accused by the Post Office of taking £36,000 from the village shop she ran in Hampshire.

But now the Post Office is to pay almost £58m to settle a long-running dispute with sub-postmasters and postmistresses.

"You dream about victory, but now it's actually here," said Mr Hamilton.

The settlement brings an end to a mammoth series of court cases over the Horizon IT system used to manage local post office finances since 1999.

A group of postmasters said faults in Horizon led to them wrongly being accused of fraud. And on Wednesday the Post Office accepted it had "got things wrong in our dealings with a number of postmasters" in the past.

Mrs Hamilton's fight echoes that of other postmasters seeking justice. She said issues in the Horizon system led to big discrepancies in her accounts, which she reported to her Post Office area manager.

But that manager could find nothing wrong with the system, and she was put in a situation where "you had to prove your innocence".

After a distressing two-year process, she eventually pleaded guilty to false accounting at Winchester Crown Court in order to escape a more serious charge of theft.

Image copyright Getty Images

She soon gave up her shop and found it difficult to get a new job due to her criminal record. She made ends meet by doing cleaning jobs for people in her village who didn't believe she was guilty.

"I couldn't get car insurance," she said, and had to go to a specialist provider with higher premiums. "I couldn't be left alone with my grand-daughter in her classroom."

Her fight for justice is not completely over, as her conviction is still going through the review process.

But Mrs Hamilton feels vindicated. "I just feel like I'm in a daze," she said.

'Lives ruined'

Sub-postmasters run Post Office franchises across the UK, which typically provide some but not all of the services of a main post office.

The group of 550 claimants joined a civil action to win compensation last year, but their complaint goes back much further.

They alleged that the Horizon IT system - which was installed between 1999 and 2000 - contained a large number of defects.

Some said their lives had been ruined when they were pursued for funds which managers claimed were missing. Some even went to jail after being convicted of fraud.

The claimants were half way through a series of four trials when the Post Office sought mediation. It could take several weeks for individual compensation payments to be worked out.

The Post Office apologised to the claimants, saying it was grateful to them "for holding us to account in circumstances where, in the past, we have fallen short."

'Reset the relationship'

Mr Read said: "I am very pleased we have been able to find a resolution to this longstanding dispute.

"Our business needs to take on board some important lessons about the way we work with postmasters, and I am determined that it will do so. We are committed to a reset in our relationship with postmasters, placing them alongside our customers at the centre of our business."

Alan Bates, former sub-postmaster of the Craig-y-Don branch in Llandudno, and one of the lead claimants, said: "[We] would like to thank Nick Read, the new chief executive of Post Office, for his leadership, engagement and determination in helping to reach a settlement of this long-running dispute.

"It would seem that from the positive discussions [we have had] there is a genuine desire to move on from these legacy issues and learn lessons from the past."

The Horizon system, which is provided by Fujitsu, is still being used in all 11,500 Post Office branches in the UK.

This is a major climb down by the Post Office which has made multiple appeals to try to see off the court case.

But legal costs were stretching into the tens of millions, so the price of losing at the end of this mammoth legal process could have been a great deal higher.

It's not clear yet how much individual postmasters and mistresses will receive.

Lawyers' fees have to be taken off, along with a charge from the litigation backer, Therium.

But just looking at the £58m suggests payouts could be in the tens of thousands and even higher for the worst affected.