Nationwide, about 200,000 mortgage holders were affected, according to Natalie Bauer, a Madigan spokeswoman.
The assets of now-defunct Countrywide, which was based in Southern California, were purchased by Bank of America, based in Charlotte, N.C., Bauer said.
The settlement calls for an independent administrator to contact and distribute compensation payments to borrowers identified by the Justice Department as victims of Countrywide's discrimination.
According to the statement, individuals who believe they were victims of Countrywide lending discrimination and have questions about the settlement should email countrywide.settlementusdoj.gov.
The settlement stems from Madigan's lawsuit in June 2010 against Countrywide Financial Corp., Countrywide Home Loans Inc. and Full Spectrum Lending Inc., an arm of Countrywide that mostly sold subprime loans.
The suit alleged numerous violations and included data showing minority borrowers paid more for mortgages than white borrowers and were more often sold riskier home loans despite qualifying for prime, or low-cost, loans.
Madigan's analysis of Countrywide loan data found that these disparities could not be explained by objective factors such as borrowers' credit scores or their debt-to-income ratios, Bauer said.
Madigan's suit and subsequent settlement follows years of investigation by her office into Countrywide's lending policies and practices during the years leading up to the housing market's collapse.
Madigan issued a fair lending subpoena to Countrywide in March 2008, after a study by the Chicago Reporter magazine of federally collected mortgage-lending data for the Chicago area found that, in 2006, Countrywide Financial Corporation sold higher-cost loans to 50.9 percent of its black borrowers and 33.8 percent of its Hispanic borrowers, while only 19.5 percent of the company's white borrowers received high-cost loans.
U.S. Attorney General Eric Holder called the settlement the Justice Department's largest residential fair-lending settlement.
Dan Frahm, a Bank of America spokesman, said: "We reached this settlement to resolve issues about Countrywide's alleged historic practices that occurred before Bank of America acquired the company. Bank of America's practices are not at issue.
"We are committed to fair and equal treatment of all our customers, and will continue to focus on doing what's right for our customers, clients and communities."