Toyota’s auto-loan division has agreed to pay $21.9 million in restitution to thousands of black, Pacific Islander, and Asian customers whom the government said were charged higher interest rates than white borrowers.

The settlement, announced Tuesday, came about because beginning in 2013 the U.S. Consumer Financial Protection Bureau and the Department of Justice had investigated the Toyota Motor Credit Corporation for unfair pricing. Federal agencies said that from 2011 up to 2016 borrowers of color regularly paid Toyota between $100 and $200 more in interest rates than a white borrower with similar credit. The discriminatory system that allowed the unfair pricing is called “dealer markup,” a little-known loan-inflation tactic that allows dealers to make more money; and in this case, at the unequal expense of minorities.

Here’s how the markup worked: Auto dealers often offer in-house financing. And when a person chooses that route, the dealer sends the buyer’s credit score and other loan risk factors to, in this case Toyota Motor Credit Corporation. The dealer learns the rates the buyer has qualified for, but then is allowed increase it, as the dealer sees fit. That inflated rate can translate into profit for the dealer. It’s usually a small amount—Toyota allowed its dealers to increase rates up to 2.5 percent. But that adds up over years of interest.

The CFPB found that, when the dealer was allowed to decide which customers to charge more, people of color, regardless of their credit, most often paid higher interest.

Toyota Motor Credit has also agreed to reduce the amount of markup its dealers can inflate, capping it at 1.25 percent for five-year loans, and 1 percent for loans with longer terms—an agreement that limits the discriminatory practice, but doesn’t eradicate it.

The Toyota Motor Credit Corporation said in a statement that it denies any wrongdoing. It also said it “does not tolerate discrimination of any kind, even perceived or unintentional.”

The Consumer Financial Protection Bureau said the lender hadn’t “intentionally discriminated against its customers, but rather that its discretionary pricing and compensation policies resulted in discriminatory outcomes.” Meaning that even though Toyota’s markup policy didn’t inherently discriminate against some people, it did allow dealers to vary prices. And that variation increased when a person was black, a Pacific Islander, or Asian.

Toyota is not the only auto lender to be investigated for this practice. Recently, Honda's lending arm and a couple of U.S. banks have all settled with the bureau in similar cases.