US banking giant JPMorgan Chase on Friday reported a rare quarterly loss due to high legal costs, even as its underlying business produced results that bested expectations.

The bank, the nation's largest by assets, reported a net loss of $380 million on revenues of $23.12 billion, due in large part to a $9.15 billion charge for legal expenses following a series of high-profile regulatory problems.

The loss was the company's first since the second quarter of 2004.

However, when the special items were stripped away, the bank earned $1.42 per share, 21 cents above expectations.

JPMorgan chief executive Jamie Dimon said the results demonstrated "strong underlying performance across the businesses" but that financials were "marred by large legal expenses."

JPMorgan is attempting to simplify its businesses and resolve a number of regulatory issues as it copes with what it describes as an "unprecedented" amount of scrutiny. The bank emerged from the financial crisis in good shape, but it has come under fire in the era of debate over institutions that are "too big to fail."

JPMorgan chief financial officer Marianne Lake described the company's efforts to estimate its legal exposure as difficult given "the rapidly evolving, fluid and volatile nature of the environment."

JPMorgan officials were reportedly shocked by the government's expectations regarding the size of a settlement to resolve violations relating to mortgage-back securities prior to the housing bust. A source told AFP last month the discussions center on an $11 billion payment. Bank officials Friday declined to comment on the $11 billion figure.

The company is pushing for a "fair and reasonable settlement" on mortgage-related issues. It noted that some of the problems stem from its acquisitions of Bear Stearns and Washington Mutual during the financial crisis that were undertaken "at the request or encouragement of the US Government."

"I wish we could reduce the uncertainty for investors, but we can't," Dimon said of the current estimate on legal costs.

The additional $9.15 billion in legal reserves take JPMorgan's overall pot of money to resolve litigation to $23 billion. Dimon said "a lot" of this sum is expected to go to mortgages, but that the sum includes other regulatory and legal issues.

JPMorgan in September signed off on a $920 million settlement to resolve some civil charges related to the "London whale" debacle, during which the company lost $6.2 billion in errant and poorly-managed trades.

The bank in July also agreed to pay $410 million in penalties to resolve charges it manipulated some US electricity markets.

However, regulators continue to probe both of these cases as well as a number of other areas in addition to the mortgage litigation.

Excluding the litigation charge and other special items, JPMorgan said it earned $5.83 billion, slightly more than the $5.71 billion in the year-ago period.

Highlights included a rise in average commercial bank loans to $196.8 billion compared with 190.9 billion a year earlier. Bank results were also lifted by lower provisions for credit losses related to mortgages, credit cards and some of its other consumer-oriented services.

In addition, the company's decline in revenues from foreign exchange, commodity and currency trading was more modest compared with expectations, while investment banking also outperformed, analysts said.

"Get on Board: (Investment Banking) and Credit Deliver Strong Results to a Skeptical Market," headlined a note from Morgan Stanley.

But other aspects of the report revealed the weight from a still-weak economy. Average loans in the bank's credit card services division declined slightly from the year-ago period.

Meanwhile, mortgage revenues continued to drag lower in the wake of higher interest rates. Total revenue declined to $2.0 billion, 45 percent off the of the year-ago level.

Dimon told a conference call the bank has begun to make contingency plans in case the US budget debates in Washington are not resolved soon. These include potential loans to recipients of welfare, social security and other government programs.

Dimon predicted Washington would meet its deadline to raise the debt ceiling.

"The country cannot have a debt default," Dimon said.

JPMorgan shares were trading in a choppy fashion, opening higher before going negative at mid-morning, then recovering again. Shares were up 0.4 percent to $52.73 around lunch-time.