JPMorgan has been hit by $9.2bn worth of legal expenses which has resulted in the US banking giant posting its first ever quarterly loss under chief executive Jamie Dimon.

The legal expenses, which worked out as $7.2bn (£4.5bn, €5.3bn) after taxes, include money JPM is setting aside for future settlements with authorities.

"While we expect our litigation costs should abate and normalise over time, they may continue to be volatile over the next several quarters," said Dimon in a statement.

The bank posted a loss of $380m, or 17 cents per share, for the third quarter. This marked its first negative results period since the second quarter of 2004. The year before it reported a profit of $5.71bn or $1.40 a share.

Dimon called the litigation issues "painful" as the bank revealed that it has set aside a bumper sum of $23bn for any legal fees, settlements and other legal expenses.

"I wish we could reduce the uncertainty for investors, but we can't," said chief financial officer Marianne Lake.

JPM has "every intention to continue to pay[ing] our dividends," she added as the bank managed to book a profit of $5.82bn or $1.42 per share in the third quarter, after stripping out litigation expenses and other special items.

Legal Woes for JPM

JPM is tipped to pay a $11bn penalty in a bid to put an end to a raft of government mortgage product related probes.

However, it has hit a roadblock following a dispute with the Federal Deposit Insurance Corp over responsibility for losses at the former Washington Mutual group.

The bank has already stumped up nearly $1bn in fines related to the London Whale trading scandal, which has cost the bank billions of dollars in legal losses.

On the same day JPM was ordered to refund $300m to customers after US regulators ruled that two million clients were harmed by the bank's debt collection and other credit card practices.

Regulators also said that there were errors in the way the investment bank pursued customers through the court.

However the refund order is not a fine, so regulators and prosecutors can still slap JPM with financial penalties in the future.

In July this year, the Federal Energy Regulatory Commission (Ferc) ordered JPM to pay $410m in relation to violating rules and manipulating the physical power markets. The total settlement comprises a civil penalty of $285m to the US Treasury and a repayment of $125m in "unjust profits."