Citibank N.A. has agreed to pay a $25 million civil penalty for allegedly violating the Fair Housing Act by failing to offer all eligible customers mortgage discounts and credits, adversely affecting some borrowers on the basis of sex, race, nationality or color.

Under the consent order with the Office of the Comptroller of the Currency, the bank also agreed to reimburse $24 million to about 24,000 customers for failing to offer them mortgage discounts that they were eligible for under a loan pricing program at Citibank, the OCC said in a statement Tuesday. The OCC said the bank has largely completed a plan to reimburse its customers. The fine will be paid to the U.S. Treasury.

The bank neither admitted nor denied the charges under the order.

The OCC found Citibank had control weaknesses related within its Relationship Loan Pricing program, or RLP, between 2011 and 2015, according to an OCC statement. The program was designed to provide eligible mortgage loan customers a credit to closing costs or an interest rate reduction.

“Citibank failed to ensure effective internal controls, including periodic reviews, and failed to inform customers of the discount programs they were eligible for between 2011 and 2015,” according to the order. The bank also failed to train loan officers properly.

“As a result of the ineffective risk management and control weaknesses, certain bank borrowers did not receive the RLP benefit for which they were eligible and were adversely affected on the basis of their race, color, national origin, and/or sex,” the OCC said in the order.

The bank discovered the problem in 2014 and self-reported it to the OCC in 2015. The OCC notified Citibank last year that the conduct violated fair housing laws, according to the order.

In a lengthy statement, Citibank said that “the errors affected borrowers across gender, race and ethnicity” and emphasized that the bank both identified them and reported the problems itself.  A spokesman said the 24,000 customers represent less than 4 percent of total mortgage loans closed by the bank.

“Across its products, Citi provides equal access and opportunity for credit for applicants, regardless of race, ethnicity and gender and is committed to ensuring that customers are treated fairly.” The bank also said, “we continue to closely monitor implementation and, if we identify an instance in which an eligible customer does not receive the full benefit of relationship pricing as intended, we will act promptly to correct. We apologize to our customers for the errors and are pleased to have the matter resolved,” the bank's statement provided by a spokesman said.