Credit Suisse has formally agreed to pay $5.3 billion to settle with U.S. authorities over claims it misled investors in residential mortgage-backed securities it sold in the run-up to the 2008 financial crisis.

As part of the settlement, announced by the U.S. Department of Justice on Wednesday, the Zurich-based bank acknowledged that home loans it pooled into the securities did not meet underwriting guidelines, with some described by employees as “complete crap” and “utter complete garbage.”

“The bank concedes that it knew it was peddling investments that were likely to fail,” Principal Associate Attorney General Bill Baer said in a statement announcing the deal.

Credit Suisse will pay a $2.48 billion cash penalty and provide $2.8 billion in consumer relief, including loan forgiveness and financing for affordable housing, the Justice Department said in the statement.

Credit Suisse, which had announced the agreement in principle on Dec. 23, said in a statement it was “pleased to have reached an amicable settlement that allows the bank to put this legacy matter behind it.”

The settlement clears the biggest cloud over Credit Suisse. However, the total amount in U.S. penalties could climb as the bank is still defending itself against lawsuits by the New York and New Jersey attorneys general over similar claims involving billions of dollars in investor losses.

Shares of Credit Suisse on the Swiss stock exchange closed down 2.5 percent at 15.28 Swiss francs, a steeper drop than the broader European banking sector.

The deal was announced the day after Deutsche Bank formally agreed to a $7.2 billion settlement over its sale of toxic mortgage securities, also split between cash and consumer relief.

The U.S. authorities sued Barclays and two former executives on Dec. 22 over similar claims. Barclays has said it would “vigorously defend” the case.

The settlements and lawsuit stem from an initiative launched in 2012 by U.S. President Barack Obama to hold Wall Street accountable for misconduct in the sale of the securities that helped trigger the worst economic crisis since the Great Depression.

Major U.S. banks, including JPMorgan Chase & Co and Bank of America Corp, have paid a total of $46 billion to resolve similar conduct involving the quality of loans pooled and sold, with some borrowers incapable of repaying and inflated property appraisals.

While the Credit Suisse settlement will likely be the last under the Obama administration, other banks under investigation include Royal Bank of Scotland, Wells Fargo & Co , UBS Group AG and HSBC. (Additional reporting by Joshua Franklin in Zurich.)