"The pact with the Federal Housing Finance Agency includes $4 billion to settle a lawsuit alleging the bank misled Fannie and Freddie about the quality of securities J.P. Morgan and two other banks it later acquired had sold to the housing-finance giants during the housing boom. The deal also includes $1.1 billion to settle separate demands from Fannie and Freddie that J.P. Morgan buy back loans that the housing-finance companies said had run afoul of their underwriting standards.

"'This is a significant step as the government and J.P. Morgan Chase move to address outstanding mortgage-related issues,' said FHFA Acting Director Edward DeMarco. Resolving the outstanding lawsuit 'provides greater certainty in the marketplace and is in line with our responsibility for preserving and conserving Fannie Mae's and Freddie Mac's assets on behalf of taxpayers.'"

This deal is one part of a greater settlement said to be worth $13 billion. As we reported on Saturday, the bank has reached a tentative deal that would "settle civil charges related to wrongdoing by some of its units just before and during the housing crisis."

"Today's settlements totaling $5.1 billion are an important step towards a broader resolution of the firm's MBS-related matters with governmental entities, and reflect significant efforts by the Department of Justice and other federal and state governmental agencies," JPMorgan Chase said in a statement.

Just before the news of the $5.1 billion settlement broke, Bloomberg reported that the $13 billion deal had hit a snag, because Chase was wanted to make the Federal Deposit Insurance Corp. "liable for part of the payment."

Update at 6:44 p.m. ET. Probably Not A Deterrence:

John C. Coffee Jr., the Adolf A. Berle Professor of Law at Columbia University, explained to our Newscast unit that this case is about the government claiming fraud, saying that JPMorgan or the companies it later bought had sold portfolios to Freddie Mac and Fannie Mae without revealing just how toxic the mortgage-backed securities in them had become.

Coffee said, however, that this may not do anything to deter future shady behavior. To do that, Coffee said, the government has to target individuals as well.

"This is a cost that ultimately will be borne by the shareholders and the shareholders of JPMorgan are too dispersed and diffused to take meaningful collective action against management," Coffee said.