The Supreme Court ruled Friday that a man who lost a large sum of money placing online horse race bets should be able to treat his losses as tax deductible, rejecting an appeal by the state.

The decision was in line with the top court's ruling in March 2015 that found costs for the purchase of horse race slips that proved unsuccessful could be treated as tax deductible if the tickets were "bought on a regular basis for the purpose of making profits."

After that landmark decision, the National Tax Agency issued a notice listing the use of software for the automatic purchase of horse race betting tickets as a condition for the tax deduction to be applied for such failed bets.