High Street banks have won their appeal over unauthorised overdraft charges.

The Supreme Court ruled in favour of the seven major banks and a building society, which had challenged High Court and Court of Appeal decisions that the charges come under "unfair contract" rules and are therefore subject to regulation by the Office of Fair Trading.

The result was awaited by tens of thousands of customers whose refund claims have been frozen while the test case went through the courts.

Handing down the unanimous ruling Lord Phillips, president of the Supreme Court, said: "It may be open to the Office of Fair Trading to assess the charge under other criteria."

Customers who go into unauthorised overdraft or breach their agreed limit can be charged as much as £35 or more for a single bounced payment.

Campaigners claim the actual cost to the banks could be as little as £2.50.

If the banks had lost the test case, it could have cost them £2.6 billion a year in lost revenue and led to their having to make refunds of up to £1 billion.

Before refund claims were frozen, banks had already paid out more than £559 million to customers who complained about "rip-off" overdraft charges.

But many of the high street banks have already changed the structure of the fees they charge people who go into the red, with or without permission.

Lord Walker, one of the five Justices of the Supreme Court who heard the case, pointed out that the outcome of the appeal "may cause disappointment and indeed dismay to a very large number of bank customers who feel that they have been subjected to unfairly high charges in respect of unauthorised overdrafts".

But he said that as Lord Phillips had explained it was not the end of the matter and Parliament "may wish to consider the matter further".

The test case to decide the legal issues thrown up by the dispute was brought jointly by the OFT and Abbey, Barclays, Clydesdale, Halifax Bank of Scotland and Lloyds TSB - which are now part of the same group - HSBC, Royal Bank of Scotland Group and Nationwide Building Society.