Citigroup said that it will pay $7 billion to settle charges that it misled investors in its sale of mortgage-linked securities ahead of the financial crisis.

Citi said the settlement with the US Department of Justice and other government bodies resolves "substantially all" of its litigation on mortgages before 2008. The bank will take a $3.8 billion pre-tax charge to cover the settlement.

Under the settlement, Citigroup will pay $4.5 billion in cash and $2.5 billion in consumer relief. The cash component consists of a $4.0 billion civil penalty to the Justice Department. Consumer relief includes financing for the construction of affordable rental housing and principal reduction.

"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," Citigroup chief executive Michael Corbat said.

Citigroup's settlement follows a $13 billion settlement between Justice and JP Morgan Chase last November on similar charges. The Justice Department has been in talks with Bank of America on a comparable case.

Besides the legal charge, Citi's second-quarter earnings were marred by an industry-wide drop in trading revenue that is also expected to hit JP Morgan Chase, Goldman Sachs and others when they report earnings later this week.

Those effects were offset by lower operating costs following corporate reorganisations, better credit quality and improved results in several categories of investment banking.

Excluding the legal settlement, Citi's results translated to  profits of $1.24 per share, much better than the $1.05 projected by analysts. Including the legal charges, earnings were just three cents per share.

Revenues dropped to $19.3 billion from $20.5 billion a year ago. Analysts had projected revenues of $18.9 billion.

Citi shares rose 3.9% to $48.82 in pre-market trade.