Justice officials called it the largest residential fair lending settlement in history.
The department had alleged Countrywide and its mortgage lending subsidiaries engaged in a widespread pattern or practice of discrimination against qualified African-American and Hispanic borrowers from 2004 through 2008. The lender was accused of charging more than 200,000 minority borrowers higher fees and interest rates than white borrowers.
The settlement, which requires court approval, was filed in the U.S. District Court in Los Angeles.
The federal government also alleged Countrywide discriminated by steering thousands of African-American and Hispanic borrowers into subprime mortgages when white borrowers with similar credit profiles received prime loans.
"The department's action against Countrywide makes clear that we will not hesitate to hold financial institutions accountable, including one of the nation's largest, for lending discrimination," Attorney General Eric Holder said in a release. "These institutions should make judgments based on applicants' creditworthiness, not on the color of their skin. With today's settlement, the federal government will ensure that the more than 200,000 African-American and Hispanic borrowers who were discriminated against by Countrywide will be entitled to compensation."
The settlement also requires Countrywide to put in place policies and practices to prevent discrimination if it returns to the lending business during the next four years. Countrywide, which now operates as a subsidiary of Bank of America, does not originate new loans.