Citigroup is close to an agreement to pay $7 billion to settle allegations that it sold shoddy mortgages before the 2008 financial crisis.

Reuters, the Wall Street Journal and the Financial Times reported the deal, which would end long-running negotiations with the Department of Justice. The DOJ had threatened to sue Citigroup for allegedly defrauding investors of billions of dollars worth of mortgage securities in the run-up to the financial collapse.

The DOJ had been pushing for a $10 billion settlement while Citigroup had been holding out for $3 billion, according to the reports. News of the possible deal appeared to come as a relief to investors, who pushed Citigroup’s share price up about 1 percent in after-hours trading.

JPMorgan Chase & Co paid $13 billion in November to resolve a range of probes in a deal U.S. authorities said would serve as a template for other banks. Bank of America has also been in negotiations to resolve similar investigations.

The 2008 crisis was caused in part by a flood of subprime mortgage loans to unqualified borrowers. The loans were then sliced up and sold by banks in securities to investors unaware of their shaky backing. When the housing and mortgage-markets cratered, investors were stuck with billions of dollars in depleted or worthless securities.