Retailers will no longer have to pay millions of pounds in business rates for cash machines outside their shops, following a ruling by the Appeal Court.
Since 2010 supermarkets and convenience stores have been liable to pay rates on the machines.
But the court ruled that about £300m they have already been charged will now have to be refunded.
Part of that money will have to come from the government, and part from local authorities.
The shops that will immediately benefit include Sainsbury's and Tesco, which had taken the case to appeal.
The court also decided that The Valuation Office - which brought the original case - should not be allowed to appeal to the Supreme Court.
However the Valuation Office can still petition the Supreme Court should it wish to do so.
Tesco said it welcomed the judgement, which applies only to England and Wales.
"We recognise the vital role that ATMs play in the daily lives of our customers and remain committed to providing this service to them," a spokesperson said.
"We welcome today's result and the confirmation of our belief that ATMs should not be separately rateable."
The Co-Op said it was a victory for people who rely on ATMs.
"The case had threatened the viability of the ATM network, and risked the future of much-needed banking services across communities," a Co-Op spokesperson said.
But the ruling now leaves a question mark over how the money raised from cash machines will be replaced.
This year that is likely to amount to £44.54m, according to the business rates consultancy Altus.
ATM operator Cardtronics was also involved in bringing the case.
Jerry Schurder, the head of business rates at Gerald Eve, which represented Cardtronics, said: "Retailers with ATMs within their properties will be extremely pleased at a decision that will lead to both refunds for previous payments backdated as far as April 2010 and reductions to future bills.
"The UK's High Street is under enormous pressure from all directions, and a big part of this has been the unfair nature of the business rates system."
The Appeal Court also rejected an attempt by the Valuation Office to get retailers to pay business rates on machines inside their shops as well.
This would have hit many small shops and convenience stores.
"We especially welcome the Court's rejection of the Valuation Office's attempt to separately rate internal machines, the consequences of which would have been dire," tweeted Mr Schurder.
The Valuation Office said it was now considering its position.