New York-based Citigroup and the Department of Justice announced on Monday a $7 billion settlement for the bank's involvement in mortgage-backed securities it sold leading up to the 2008 financial crisis.

After months of negotiations that at times nearly broke down, the government and the New York investment bank were able to come to terms on a settlement that'll net the Justice Department $4 billion. In the settlement, Citigroup agreed to pay an additional $2.5 billion to consumer relief that will go toward things like affordable housing projects.

In November, the Justice Department and JPMorgan Chase agreed to a settlement of $13 billion.