High Court Judge Mrs Justice Foster ruled in favour of Andy Green, from Lincolnshire, who had been locked in a three-year court battle with the UK bookmaker.
Green will receive full payout on top of interest. Betfred said it would not appeal the ruling.
"Along with my family, I have been through some very low times and become very down," Green said in a statement. "My physical health has also suffered badly, and I sometimes wished I'd never won this money, because it was just making my life a misery.
"But today, I feel like the world has been lifted off my shoulders and I feel so incredibly happy and relieved - for me, my family and my legal team. The champagne can finally come off ice and be savoured."
Green won the jackpot in 2018 on the Frankie Dettori Magic Seven Blackjack game. Days later Betfred contacted Green to tell him there had been a software malfunction in the machine and that his prize would be rejected.
By then Green had already spent more than £2,500 celebrating his win. Betfred originally tried to settle the case by paying Green £60,000 in exchange for his silence, but he rejected that offer.
In 2019 he took his case to High Court to challenge Betfred’s claim of a software error, which was apparently an error from supplier Playtech. Green said he suffered four heart attacks since 2018.
Betfred argued that the machine Green played on didn’t reset properly, leading to his improbable jackpot. The company claimed the software glitch was covered under the game’s terms and conditions.
Mrs. Foster said that argument was “inadequate” in her ruling in favour of Mr Green.