Another major bank will pay the government over its role in the housing crisis.

Bank of America announced Thursday that it reached an agreement with federal and state regulators to pay nearly $17 billion to end lawsuits related to deficient home loans and mortgage-backed securities sold prior to the financial crisis.

The Department of Justice said that it would be the single largest settlement with a U.S. business in history. The agreement includes $9.65 billion in cash paid out to federal and state agencies, and nearly $7 billion in consumer relief to borrowers hurt by the mortgage crisis.

The settlement mostly relates to improper deals made by the mortgage lender Countrywide Financial and the investment bank Merrill Lynch before those businesses failed and were acquired by Bank of America in 2008, during the worst of the financial crisis.

In an announcement of the deal, Attorney General Eric Holder called the settlement a "historic step forward in our ongoing effort to protect the American people from financial fraud" and to hold banks accountable for past fraud.

The settlement includes an acknowledgment on Bank of America's part that it misled investors and misrepresented the soundness of loans it sold to the Fannie Mae and Freddie Mac and the Federal Housing Administration, according to the Justice Department.

It does not, however, include criminal charges for specific bank employees who defrauded borrowers, investors and the government. Holder said "this outcome does not preclude any criminal charges against the bank or its employees.”

The settlement, which Bank of America CEO Brian Moynihan said "was in the best interests of our shareholders, and allows us to continue to focus on the future," resolves actual and future lawsuits against the bank from the DOJ, the Securities and Exchange Commission, several state attorneys general, the FHA, and the Federal Deposit Insurance Corporation.

It raises the total amount of money paid by banks to President Obama’s Financial Fraud Enforcement Task Force for faulty loans to $36.65 billion, according to the DOJ.

Previously, the largest similar payout was JPMorgan's $13 billion settlement with the DOJ in November.