The Halifax will make payments to 300,000 mortgage customers, up to a £500m total, after reaching a deal with the Financial Services Authority (FSA).
The bank, now part of Lloyds Banking Group, admitted confusing customers about its right to charge them more for their standard variable rate mortgages.
The Halifax raised the margin on some of these mortgages from 2% to 3% above base rate in January 2009.
Lloyds said its agreement had been a "voluntary" and "proactive" one.
"The group is committed to running its business with the highest levels of integrity and treating its customers fairly, and therefore believes that a proactive co-ordinated programme to identify affected customers and make goodwill payments is the appropriate course of action," Lloyds said.
Halifax said that some customers would receive a flat-rate payment of £250.
Others will receive a variable payment, related to the rise in their interest payment and the size of their mortgages. This could range from hundreds of pounds to several thousand pounds.
The problem arose in the autumn of 2008 and early 2009 as the Bank of England progressively cut its official bank rate from 5% to 0.5% to help stave off the effects of the banking crisis.
The Halifax decided not to cut its standard variable rate (SVR) in step with the Bank of England, thus increasing its margin above base rate.
The Halifax admitted that its mortgage offers issued between September 2004 and September 2007 had not been as clear as they could have been and had the "potential to cause confusion".
The lender had not made it clear that its terms and conditions meant it could later vary the charge for customers who went onto its standard variable rate.
The problem was first highlighted at the time by Ray Boulger of mortgage brokers John Charcol.
He had queried whether or not the Halifax had the right to change its SVR from a 2% margin over base rate to a 3% margin if the offer documentation, stating the key facts of the deal, had not explicitly mentioned the bank's right to do so.
"The issue was whether the terms under which the Halifax could vary the rate cap had been met," he told the BBC.
"I am surprised it has taken to so long to sort out."
Typically the affected customers were those whose mortgage deals reverted to the Halifax SVR once their fixed-term or tracker rate deal had expired.
The Halifax raised the ceiling on its SVR from bank rate plus 2% to bank rate plus 3% with effect from January 2009, citing "extenuating economic conditions".
This meant that some 300,000 customers at this point were charged more than would otherwise have been the case.
"We have had very few complaints - in the tens, fewer than 50," said a Halifax spokesman.
"It has been a very complex area, involving digging out lots of historical mortgage documentation," he added.
About 600,000 customers will be contacted by the Halifax, however, about 300,000 customers will not receive a payment as they were not paying the SVR on their mortgage during the period affected.
Those who were affected and who are still with the Halifax will have their mortgage accounts credited in April this year.
If they have left the Halifax they will be traced and offered a cheque.