Ally Financial, one of the nation’s largest automobile lenders, has agreed to pay $98 million to settle charges that it systematically allowed minorities to be charged more for car loans than whites.

The agreement, which federal officials called the government’s largest-ever auto loan discrimination settlement, requires Ally to pay $80 million to compensate borrowers who were overcharged for loans and an additional $18 million to the Consumer Financial Protection Bureau’s civil penalty fund.

The settlement resolves allegations by federal officials that Ally and its sister company, Ally Bank, discriminated by charging 235,000 minority borrowers higher rates than whites in the year following April 2011. On average, black, Hispanic and Asian American customers paid between $200 and just over $300 more for auto loans than whites who were equally creditworthy, federal officials charged.

“With this largest-ever settlement in an auto-loan discrimination case, we are taking a firm stand against discrimination in a critical lending market,” Attorney General Eric H. Holder Jr. said in a statement.

The alleged discrimination took place as part of a common industry practice that is invisible to borrowers but allows auto dealers to mark up interest rates offered by finance companies such as Ally, federal officials said.

Finance companies such as Ally set an interest rate based on objective criteria — including a borrower’s credit history and the size of his or her down payment — and then dealers are free to increase the interest rates within certain limits. The finance companies and the dealers then split the extra profits.

The system “creates financial incentives for dealers to mark up borrowers’ interest rates above those established based on the consumers’ creditworthiness,” according to the complaint filed Friday in federal court in Detroit.

Ally was known as GMAC before rebranding itself and receiving a $17. 2 billion bailout from the federal government’s Troubled Assets Relief Program during the height of the financial crisis. As auto lending and sales have surged in the years since the crisis, the company has repaid all but $4.9 billion, Gina Proia, Ally’s chief communications officer, said.

Although the company agreed to the settlement, it said that it does not receive information about borrowers’ race or ethnicity, and, consequently, does not discriminate.

“Ally does not make loans directly to consumers, but rather, it purchases installment contracts originated by auto dealers,” Ally said in a statement. “Ally assesses these contracts and sets pricing based solely on a consumer’s creditworthiness and contract characteristics.”

The company added that its own analysis found no evidence that the thousands of dealers through which it makes auto loans discriminated. “Regardless, Ally takes the assertions by the CFPB and [Justice Department] very seriously and has agreed to the terms” of the settlement, it said.

Federal officials said that despite the indirect nature of Ally’s lending, it has not done enough to ensure that dealers do not discriminate.

“Ally fails to adequately monitor its interest rate markups for discrimination or require dealers to document their markup decisions,” according to a statement released by the Justice Department and the CFPB. “Ally’s first effort to monitor for discrimination in interest rate markups began only earlier this year after it learned of the CFPB’s preliminary findings of discrimination.”

Beyond the $98 million in settlement payments and a requirement that Ally refund any future discriminatory interest rate charges, the deal requires Ally to better monitor how its loans are made.

The investigation into Ally’s loan practices involved a statistical analysis of the surnames of 800,000 auto loan customers, since auto loan data are not collected by race. The surnames were linked to race through a technique widely used by social scientists, according to the government complaint.

Through that process, investigators found that Ally charged African American borrowers interest rates that were 29 basis points — just over a quarter of a percentage point — higher than those charged to equally qualified white borrowers. That difference, on average, cost black borrowers more than $300 in additional interest charges over the life of a loan.

For Hispanics, the disparity was 20 basis points, which cost them on average $200 more in interest charges than equally creditworthy white borrowers. For Asian Americans, the disparity with whites was 22 basis points, which resulted in additional interest payments of more than $200 a month, the government charged.

“Discrimination is a serious issue across every consumer credit market,” CFPB Director Richard Cordray said in a statement. “We are returning $80 million to hard-working consumers who paid more for their cars and trucks based on their race or national origin.”