JPMorgan Chase & Co is in advanced talks with U.S. regulators to resolve a probe into its role in selling subprime mortgage-backed bonds in 2007, a case that highlights a rare misstep by Chief Executive Jamie Dimon.

JPMorgan disclosed in a regulatory filing on Friday that it was in talks with the U.S. Securities and Exchange Commission to resolve the probe, which a source familiar with the situation said was about the bank's dealings with hedge fund Magnetar over the creation of collateralized debt obligations (CDOs).

The second-largest U.S. bank by assets, and its chief executive, have avoided much of the mortgage controversy that has dogged competitors such as Goldman Sachs Group Inc, Bank of America Corp and Wells Fargo & Co over the financial crisis.

Mortgage backed securities and CDOs were at the heart of the crisis. Wall Street banks vacuumed up home loans, often subprime mortgages, and repackaged them into bonds and other securities that were sold with top-notch credit ratings.

When the U.S. housing market crashed, the securities plummeted in value, generating enormous losses for investors around the world.

Analysts said a settlement with the SEC is unlikely to lead to long-term reputational damage for JPMorgan or Dimon, who has said all banks should not be put into the same basket when discussing the financial crisis.

Every major player is going to go through this to some degree, said Matt McCormick, a portfolio manager with Bahl & Gaynor Investment Counsel. But I don't think the market is that concerned at this point. It appears there's more smoke than there is fire right now.

JPMorgan's shares closed down 0.3 percent at $45.04 on Friday.

JPMorgan's disclosure comes a day after court documents revealed the SEC had subpoenaed Credit Suisse for documents related to home loan securitizations.

The SEC also subpoenaed JPMorgan this week for records related to mortgage securitizations, according to Bloomberg.

The latest subpoenas could indicate a further expansion of the SEC probe into U.S. lenders' mortgage-related dealings.

The SEC is taking a more active role in following up on things that are happening in private litigation, said Thomas Gorman, a partner at the law firm Dorsey & Whitney LLP.

Gorman said securities regulators' subpoenas may not be part of a new investigation but an expansion of an on-going probe.

MAGNETAR DEAL

JPMorgan previously said it had received a number of subpoenas and informal requests from federal and state authorities over CDOs and mortgage-backed securities.

Recent government reports and lawsuits have accused traders and bank executives of knowingly packaging dodgy loans into bonds and other securities, at times even betting against the bonds as they touted them to clients.

The SEC investigation centered around whether JPMorgan adequately disclosed to investors that Magnetar helped to select assets for the CDO deal while betting against parts of it, The Financial Times reported in April.

JPMorgan pulled back from the CDO market in 2005, but re-entered the business and expanded in 2006, according to news website ProPublica. JPMorgan and Magnetar agreed to a deal in early 2007 to create and sell a $1.1 billion CDO, according to ProPublica.

In its disclosure filing on Friday, JPMorgan estimated its maximum possible losses from legal proceedings, in excess of established reserves, at $4.5 billion as of March 31, unchanged from its estimate as of December 31.

Wells Fargo, the nation's largest mortgage lender, said its worst-case litigation costs were rising due to foreclosure-related matters. It said its maximum possible loss from legal proceedings rose $500 million to $1.7 billion in the first quarter because of its exposure to foreclosure-related legal issues.

(Writing by Tom Hals and Joe Rauch in Charlotte, North Carolina; Editing by Tim Dobbyn, John Wallace and Matthew Lewis)