Citigroup Inc. (C) - Get Report  has agreed to pay back $335 million to customers after overcharging them on credit-card loans, under a settlement with the Consumer Financial Protection Bureau.

The company's banking unit, Citibank NA, used flawed procedures from at least 2011 through 2017 to decide whether certain customers qualified for interest-rate reductions, the CFPB said in an order released Friday. The violations involved some 1.75 million consumer credit-card accounts.

The matter first came to light in February, when New York-based Citigroup disclosed in an annual report that it had set aside money to cover a potential settlement. According to the CFPB, no fines were issued beyond the restitution payments, partly because Citibank discovered the violations on its own in 2016 and reported them to regulators early the following year.

"Citi is pleased to have resolved the matter with the bureau, and we reiterate our sincere apologies to our customers for not correcting these issues sooner," the bank said in a press release.

According to the order, Citibank failed to properly implement procedures to ensure that customer accounts were appropriately reevaluated on a periodic basis, as required under the Credit Card Accountability Responsibility and Disclosure Act of 2009.

Citigroup said in its press release that it has since revised its rate-reevaluation methods.

Refunds will average $190 and will be mostly paid out by year-end, according to the bank.