For the better part of the last month, J.P. Morgan Chase and Co. has been in discussion with the Department of Justice (DOJ) to settle civil investigations into the mortgage-backed securities it sold in the run-up to the financial meltdown. Now an agreement seems to have emerged between the banking giant and the DOJ, with a final figure of $13 billion in fines and settlements on the table. If accurate, this will be the largest settlement of its type in history.

Word of the deal comes as the DOJ threatens to file a civil case if both parties cannot come to an agreement by Oct. 23.

Despite J.P. Morgan’s attempts to close the investigations without admitting any wrongdoing, the settlement will only close civil investigations. Reports indicate that the DOJ has strong evidence of misconduct and intends to use it in a separate criminal investigation. The DOJ threatened to file the civil case if both parties cannot come to an agreement by Oct. 23.

The Wall Street Journal is reporting that the deal includes $4 billion to settle claims by the Federal Housing Finance Agency, another $4 billion in consumer relief and $5 billion in penalties paid by the bank. Those close to the negotiations say that the bank and the DOJ are still having issues agreeing on certain details, including whether the bank will need to release a statement as an admission of guilt.

The DOJ is using a hardline against J.P. as it’s the first of many legal battles it’s intending to fight with those involved with the financial crisis.  J.P. Morgan’s reputation was bruised during the “London Whale” scandal and continues to face tough questions from government agencies intent on holding those responsible for the financial crisis responsible.

J.P. Morgan has already paid billions in legal fines this year and blamed the amount of legal activity it conducted this past year as a major reason for its net loss in the third quarter of 2013. Reports say the bank has begun to set aside reserve funds in an effort to give itself a buffer for additional legal costs.