Citigroup is close to reaching a settlement of about $7 billion for bad mortgages. The settlement is the result of a U.S. Department of Justice investigation into Citi's defrauding of investors with mortgage securities leading up to the financial crisis. This was part of a larger investigation by the United States Attorneys Offices into faulty mortgage securities fueling the housing bubble and eventual crash. 

The $7 billion settlement would be in cash, including several billion for borrowers. It is a higher figure than analysts were expecting, based on the size of Citi's mortgage security industry. Previously, analysts found Citi likely had $3 billion reserved to pay the settlement, whereas U.S. authorities were pushing for a $10 billion settlement. Because the two parties were so far apart on the figure, there was a chance the Justice Department would sue Citi. 

While this is a hefty settlement, it is still only about half of what JPMorgan Chase paid in November for a similar probing. Bank of America paid $9.5 billion for their settlement relating to Freddie Mac and Fannie Mae. 

Though analysts were unprepared for the heft of this settlement, second quarter results (which will post early next week) will offer more insight into how this settlement will affect Citi's yearly profitability. Analysts believe Citi will earn $3.4 billion this quarter.