Mark Lennihan/Associated Press

JPMorgan Chase disclosed on Wednesday that it faced a criminal and civil investigation into whether it sold shoddy mortgage securities to investors in the run-up to the financial crisis, the latest legal threat to the nation’s biggest bank.

JPMorgan acknowledged for the first time the existence of the investigation — one of several mortgage-related problems looming for the bank — in a quarterly regulatory filing. It said that the civil division of the United States attorney’s office for the Eastern District of California, which covers a stretch of land that includes Sacramento and Yosemite, has “preliminarily concluded” that JPMorgan flouted federal laws with its sale of subprime mortgage securities from 2005 to 2007. The parallel criminal inquiry, according to one person briefed on the matter, is in a more preliminary stage.

Adding to scrutiny of the bank, federal prosecutors in Philadelphia are examining whether JPMorgan duped investors into buying troubled mortgage securities that later imploded, according to people briefed on the matter, who spoke on the condition of anonymity. The prosecutors are investigating whether JPMorgan churned out the mortgage-backed securities without ensuring that the investments met underwriting standards, the people said.

Representatives for the bank and the federal prosecutors declined to comment.

Once a darling in regulatory circles, JPMorgan has become a magnet for scrutiny in recent years, drawing attention from at least eight federal agencies, a state regulator and two European nations. The authorities are investigating the bank in connection with its financial crisis-era mortgage business and a $6 billion trading loss in London last year, among other issues.

As the investigations drag on, the bank is racking up significant legal costs. To help cushion against potentially hefty payouts to the authorities, JPMorgan recorded a $678 million expense for additional litigation reserves in the second quarter, up from $323 million in the same period a year ago, according to the filing on Wednesday.

The bank also estimated it could incur up to $6.8 billion in losses beyond its reserves, nearly $1 billion more than the first quarter of the year.

JPMorgan is hardly the only Wall Street firm taking heat in Washington. The investigations into the bank are playing out as prosecutors increasingly take action against Wall Street firms that bundled mortgages into complex investments in the heady days of the housing boom.

On Tuesday, Bank of America found itself in the government’s cross hairs when the Justice Department and the Securities and Exchange Commission accused the bank of defrauding investors by greatly overstating the quality of mortgages backing roughly $850 million in securities. The bank contested the accusations.

The lawsuit was the latest volley from President Obama’s federal mortgage task force, which has vowed to hold financial firms accountable for their role in the mortgage boom and bust that threatened to topple the American economy.

The working group’s first action came last October, when the New York attorney general, Eric T. Schneiderman, took aim at Bear Stearns, the firm that JPMorgan acquired during the depths of the financial crisis. The firm, Mr. Schneiderman said in a lawsuit, sold securities between 2005 and 2007 that caused roughly $22.5 billion in losses for investors.

Investors were assured, the lawsuit said, that the firm scoured the loans packaged into the investments to assure their quality. In fact, the prosecutor contended, there was little vetting.

JPMorgan is fighting the lawsuit.

A month later, however, JPMorgan agreed to a $296.9 million pact with the S.E.C. to resolve unrelated claims that Bear Stearns duped mortgage investors by failing to disclose some delinquent loans. JPMorgan did not admit or deny wrongdoing.

JPMorgan is also one of 18 banks that a federal regulator accused of selling troubled loans to Fannie Mae and Freddie Mac — the government-controlled mortgage finance giants — without fully disclosing the potential risks. The regulator, the Federal Housing Finance Agency, recently rejected a settlement offer from JPMorgan, the people briefed on the matter said, raising the prospect of a drawn-out legal battle.

In the latest investigations out of California and Philadelphia, federal prosecutors are examining whether

JPMorgan ignored evidence of broad flaws among the loans that were ultimately pooled and sold to investors, the people briefed on the matter said. The California investigation is aimed at the mortgage business that JPMorgan inherited after its purchase of Washington Mutual, the people said. It is unclear what prompted the inquiry in Philadelphia.

Facing the onslaught of unwanted attention, JPMorgan has moved to settle some cases. The bank recently struck a $410 million settlement with the nation’s top energy regulator, which had accused the bank of devising “manipulative schemes” to transform “money-losing power plants into powerful profit centers.”