There were cheers, tears and even a few bottles popped outside the Royal Courts of Justice after dozens of former subpostmasters won a long-running battle to clear their names.

Hundreds of subpostmasters were prosecuted for theft, fraud and false accounting because of the Post Office’s defective Horizon accounting system, which had “bugs, defects and errors” from the very outset.

The Post Office knew that there were “serious issues about the reliability” of the Fujitsu-developed IT system, which was rolled out to branches in 2000, but continued to bring “serious criminal charges against the subpostmasters on the basis of Horizon data”, the Court of Appeal said on Friday.

Overturning the convictions of 39 former subpostmasters who were convicted and even jailed based on Horizon data, Lord Justice Holroyde said the Post Office “effectively steamrolled over any subpostmaster who sought to challenge its accuracy”.

Shortly after the ruling, Janet Skinner – who pleaded guilty to false accounting and was sentenced to nine months in prison in 2007 – walked out of the Royal Courts of Justice in London to cheers and applause.

Ms Skinner, 50, said she was “relieved” to have finally cleared her name and began to cry as her friends and family celebrated with her.

Harjinder Butoy, who was convicted of theft and jailed for three years and three months in 2008, was also in tears as he left the court after his conviction was also overturned.

But Mr Butoy, 44, who was a subpostmaster in Nottinghamshire, was also angry at the Post Office for having “destroyed my life for 14 years”.

He branded the Post Office as “a disgrace” and “just bullies”, and called for those responsible for the scandal to face criminal prosecution themselves.

Mr Butoy said: “Somebody needs to really, really sort this out and charge them for this. It can’t be pushed under the carpet now.”

Asian Image:

Former post office worker Seema Misra, who was jailed for a conviction of theft in 2010, celebrates with her husband Davinder outside the Royal Courts of Justice, London, after their convictions wer overturned by the Court of Appeal. (Yui Mok/PA)

Asian Image:

Former post office worker Tom Hedges (centre) holds up a bottle and glass of champagne in celebration outside the Royal Courts of Justice, London. (Yui Mok/PA)

Tracy Felstead, 38, was similarly conflicted, saying that she was going through “a rollercoaster of emotions” after the ruling was handed down.

“Obviously, I’m over the moon that my conviction has been quashed after 19 years,” she said.

“I’m angry that it even got this far and they have been allowed to do this.

“Sad for all the ones who aren’t here to see all this.”

She added: “My hope is that somebody will be held accountable, that they will get to the bottom of who knew what, where and when.

“Whether that happens, I don’t know – but that’s what I hope happens.”

William Graham, 53, a former Post Office manager in Riverhead, Sevenoaks, was convicted of false accounting in 2011 and given a 32-week suspended prison sentence.

He said he was “elated and angry” after the ruling, saying: “Angry that it’s come to this, elated we’ve been exonerated, we’ve been freed from the shackles of that shame.”

Tom Hedges, 68, who was convicted of theft and false accounting and given a seven-month suspended sentence in 2011, opened a bottle of prosecco outside the Royal Courts of Justice after his conviction was quashed.

He said: “It’s a wonderful afternoon. When I told my mother, who’s 93, I was coming to court, she said: ‘Get yourself down to Aldi and get some prosecco.’

“She said: ‘Just remember your name is Hedges, not Rothschild – so get prosecco, not Bollinger!'”

Alison Hall, 52, who ran a post office near Cleckheaton in West Yorkshire said she was “going to go find a pub and have a glass of champagne” to celebrate the result.

Other subpostmasters said the Court of Appeal’s landmark ruling was not the end of the scandal and called for a full public inquiry into how dozens of people were wrongly convicted.

Della Robinson, 53, was sentenced to 140 hours of community service for false accounting in 2013.

She said: “I feel we’ve achieved something, it’s been a victory. We’ve not won anything to be honest, because we’ll never get back what we lost, but it’s just an achievement for everybody, it’s so overwhelming.”

Ms Robinson also said she wanted the people who were “behind it in the Post Office that has actually done this to people” to be held accountable.