The bank, one of America’s largest, revealed the deal as part of its quarterly earnings report. Justice Department officials were expected to discuss it at a news conference later Monday.
The settlement stems from the sale of securities made up of subprime mortgages, which led to both the housing boom and bust that triggered the Great Recession at the end of 2007.
Citigroup and other banks downplayed the risks of subprime mortgages when packaging and selling them to mutual funds, investment trusts, pensions, as well as other banks and investors.
The securities, which contained so-called residential mortgage-backed securities and collateralized debt obligations, plunged in value when the housing market collapsed in 2006 and 2007. Those losses triggered a financial crisis that pushed the economy into the worst recession since the 1930s.
The bank separately agreed in April to pay $1.13 billion to settle claims by investors seeking that the lender buy back billions of dollars in residential mortgage-backed securities.
In the deal announced Monday, Citigroup will make a $4 billion civil monetary payment to the Justice Department, and another $500 million in compensatory payments to state attorneys general and the Federal Deposit Insurance Corporation.
The bank will provide $2.5 billion in consumer relief, which will include financing for construction and preservation of affordable housing, as well as principal reduction and forbearance for residential loans.
CEO Michael Corbat said the settlement ends all pending civil investigations related to its handling of mortgage-backed securities.
The two sides had earlier been far apart in their negotiations. The Justice Department had warned last month that it would sue after the bank offered to pay under $4 billion to resolve the matter, a sum substantially less than what the government was seeking.
The bank will take a pre-tax charge of about $3.8 billion because of the settlement during its second quarter.
Citigroup said Monday that its net income dropped in the second quarter after the settlement was arranged.
That charge pushed down Citigroup’s net income to $181 million from $4.18 billion a year earlier.
On a per-share basis, net income was 3 cents, compared with $1.34 in the second-quarter a year earlier. Excluding the charges and an accounting gain, the bank’s second-quarter profit rose 1 percent to $3.93 billion, or $1.24 a share. A year earlier, the bank earned $3.89 billion, or $1.25 per share.
Revenue was $19.4 billion, excluding the accounting gain, compared with $20 billion a year earlier.
The Citigroup settlement comes months after a similar — but much larger — deal between the Justice Department and JPMorgan Chase & Co., the nation’s biggest bank. After months of negotiations, the bank last year agreed to pay $13 billion after an investigation into toxic mortgage-backed securities.
As part of the deal, which included settlements with New York, California and other states, JPMorgan agreed to provide $4 billion in relief to homeowners affected by the bad loans. The bank also acknowledged that it misrepresented the quality of its securities to investors.
That deal was seen as a possible template for settlement with Citigroup and Bank of America Corp., which was accused in a government lawsuit last summer of failing to disclose risks and misleading investors in its sale of $850 million of mortgage-linked securities. The Securities and Exchange Commission filed a related lawsuit against Bank of America.
The settlement is part of an ongoing Justice Department effort to target financial misconduct, even as critics have said the government has not been aggressive enough. In the last two months, Swiss bank Credit Suisse has reached a $2.6 billion guilty plea for helping wealthy Americans evade taxes, and French bank BNP Paribas struck an $8.9 billion deal related to its handling of transactions for clients in Sudan, Iran and Cuba.
Josh Boak and Marcy Gordon in Washington contributed to this report.