U.S. banking giant Citigroup Inc. will pay US$7 billion to settle allegations stemming from its underwriting and issuance of mortgage-backed securities in the run up to the financial crisis.

Citi (NYSE:C) said Monday that it has reached an agreement to settle an ongoing investigation into residential mortgage-backed securities (RMBS) and collateralized debt obligations (CDOs) issued, structured or underwritten by Citi between 2003 and 2008. Under the terms of the deal, Citigroup will pay a total of US$4.5 billion in cash and provide US$2.5 billion in consumer relief.

The cash payment consists of a US$4 billion civil monetary payment to the U.S. Justice Department (DOJ) and US$500 million in compensatory payments to various state attorney generals and the Federal Deposit Insurance Corporation (FDIC). It says that the promised consumer relief will take the form of financing provided for the construction and preservation of affordable multifamily rental housing, principal reduction and forbearance for residential loans, as well as other direct consumer benefits under various relief programs. The bank has agreed to provide the consumer relief by the end of 2018.

The agreement resolves actual and potential civil claims by the DOJ, several states, and the FDIC. And, in connection with the settlement, Citigroup will take a pre-tax charge of approximately US$3.8 billion in the second quarter.

“The comprehensive settlement announced today with the U.S. Department of Justice, state attorneys general, and the FDIC resolves all pending civil investigations related to our legacy RMBS and CDO underwriting, structuring and issuance activities. We also have now resolved substantially all of our legacy RMBS and CDO litigation. We believe that this settlement is in the best interests of our shareholders, and allows us to move forward and to focus on the future, not the past,” said Michael Corbat, Citigroup’s CEO.

U.S. authorities note that the settlement, which does not absolve Citigroup or its employees from facing any possible criminal charges, includes an agreed upon statement of facts that describes how Citigroup made representations to investors about the quality of the mortgage loans it securitized and sold. Yet, contrary to those representations, it says that Citigroup created and sold securities with underlying mortgage loans that it knew had material defects; which, ultimately misled investors, and contributed to the financial crisis.

“This historic penalty is appropriate given the strength of the evidence of the wrongdoing committed by Citi,” said U.S. attorney general, Eric Holder. “The bank’s activities contributed mightily to the financial crisis that devastated our economy in 2008. Taken together, we believe the size and scope of this resolution goes beyond what could be considered the mere cost of doing business. Citi is not the first financial institution to be held accountable by this Justice Department, and it will certainly not be the last.”