Around 600,000 Lloyds customers who fell behind with their mortgages are to get a payout, averaging £350.
The bank made mistakes with the way it dealt with customers who were in arrears between 2009 and 2016, by not doing enough to make sure that customers' payment plans were affordable and sustainable.
And after an investigation by the Financial Conduct Authority (FCA), it's now agreed to refund all fees charged to customers for arrears management and broken payment arrangements from 1 January 2009 to January 2016.
It says it will pay any legal fees that were applied unfairly to customers who took legal action, as well as offering payments for potential distress and inconvenience.
Meanwhile, it will also cover any other financial losses caused by customers not being able to keep up with unsustainable repayment plans - direct debit fees charged because of a broken payment plan, for example.
Around 590,000 customers are expected to get a payout, totalling around £283 million.
"We continue to engage with Lloyds as it works to improve the way it treats customers in arrears."
Lloyds says it will write to all affected customers to explain the refund they'll receive, and help them to make a claim for any distress and inconvenience they may have experienced, as well as consequential losses.
It'll pay interest on the fees and an extra 8% interest for customers deprived of funds.
This isn't the only bill Lloyds faces for dealing wrongly with customers: it's already had to set aside more than £17 billion for PPI mis-selling claims.
Another £700 million has been put by to deal with the fallout from a fraud at the Reading branch of HBOS - which merged with Lloyds in 2009 - which has led to six people being jailed.
Victims of the fraud include television presenter Noel Edmonds - who alone is asking for compensation of £300 million.
However, despite all this, Lloyds made its biggest half-year profit in eight years, at $2.5 billion.
"Today's news comes as an additional confirmation of the extent of historical misconduct in the UK banking system and the cost it has had on customers, particularly borrowers," says Dr Andreas Kokkinis of the University of Warwick School of Law.
"Although the mortgage market has since then undergone massive reforms and such practices are no longer in place, the real question is whether the regulatory framework (now the Financial Conduct Authority) and internal governance structures in banks have been sufficiently strengthened to prevent similar problems from arising in the future."