Banking giant Citigroup has agreed to pay $7 billion to settle a U.S. government investigation into securities backed by risky subprime mortgages, which contributed to the 2008 financial crisis.

The agreement, announced Monday, comes weeks after talks between the sides seemingly broke down, prompting the government to warn that it would sue the New York–based investment bank. The bank had offered to pay less than $4 billion, a sum substantially lower than what the Justice Department was seeking.

The settlement stems from the sale of securities made up of subprime mortgages, which fueled both the housing boom and bust that triggered the Great Recession at the end of 2007.

"The penalty is appropriate, given the strength of the evidence of the wrongdoing committed by Citi," U.S. Attorney General Eric Holder said in a statement on Monday.

"Despite the fact that Citigroup learned of serious and widespread defects among the increasingly risky loans they were securitizing, the bank and its employees concealed these defects," he added.

Citigroup and other banks downplayed the risks of subprime mortgages when packaging and selling them to mutual funds, investment trusts and pensions as well as other banks and investors. The securities, which contained so-called residential mortgage-backed securities (RMBSs) and collateralized debt obligations (CDOs), 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 suits by investors seeking to have 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 an additional $500 million in compensatory payments to the state attorney's 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.

“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,” said CEO Michael Corbat. “We also have now resolved substantially all of our legacy RMBS and CDO litigation.”

The bank will take a pretax charge of about $3.8 billion during its second quarter.

Shares of Citigroup Inc. rose more than 1 percent before the opening bell Monday.

The Citigroup settlement comes months after a similar — but much larger — deal between the Justice Department and JPMorgan Chase, 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, 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, which is still pending.

Al Jazeera and wire services