Toyota's lending service, Toyota Motor Credit Corp., agreed to pay almost $22 million to thousands of minority Toyota customers that were overcharged on loans from 2011 through this year. (Video via Toyota)

The company had been under investigation by the Consumer Financial Protection Bureau since 2013 for adding more interest to auto loans for black and Asian car buyers. (Video via Toyota)

The investigation found that TMCC itself wasn't responsible, but rather it was individual dealerships that marked up interest rates for minorities.

The lender from TMCC evaluates the credit of an applicant and makes a loan offer. Then dealers can tack on up to 2.5 percent more interest onto that offer — that's known as the dealer markup.

Dealer markup itself is perfectly legal, but the CFPB found that black and Asian borrowers received higher markups, costing most of them more than $100. (Video via Toyota)

The investigation found the disparity affected black borrowers more, resulting in a 0.27 percent increase compared to white buyers; Asian buyers faced a 0.18 percent increase.

TMCC denied any wrongdoing and said the company "has no visibility into the race or ethnicity of its customers or credit applicants, and these factors have no bearing on the company’s credit or pricing decisions."

As part of the agreement, TMCC will also cut its maximum dealer markup in half for loan contracts five years or less, going from 2.5 to 1.25 percent. Contracts longer than that will be capped at 1 percent.

This video includes images from Getty Images.