The U.K.’s Financial Conduct Authority (FCA) is sanctioning HSBC for failing to treat customers fairly when they were suffering financial difficulties.

The bank was fined £6.3 million for violating, in 2017 and 2018, the regulator’s principles on the fair treatment of customers by failing to accommodate customers who fell into arrears or faced other financial struggles.

“The failings were caused by deficiencies in HSBC’s policies and procedures and the training of their staff, as well as inadequate measures to identify and address instances of unfair customer treatment,” the FCA said.

The bank identified these issues itself in 2018 and alerted the FCA.

Since then, it has paid £185 million in redress to 1.5 million affected customers.

The bank has also invested £94 million to resolve the shortcomings in its policies and procedures.

“People must be able to trust their lenders to treat them fairly when in financial difficulty. By failing to do so, HSBC put 1.5 million people at risk of greater financial harm,” said Therese Chambers, joint executive director of enforcement and market oversight with the FCA, in a release.

“It deserves credit for identifying the issue and putting it right,” she said. “The cost it has incurred in doing so, however, should be a warning to all lenders that they need to understand their customers’ circumstances so as not to make a bad situation worse.”

The regulator said it took HSBC’s efforts to resolve the issue into consideration when setting the monetary penalty, and the bank earned a 30% discount on that fine by agreeing to settle. Without the discount, the bank would have been fined £8.97 million.