The bank's shares ended Friday trading in New York 5.8% higher on the news.

The profit figure for the three months to 30 June was down 8.7% from the same period last year, but was nonetheless much higher than analysts' expectations.

Meanwhile,
the Ohio state attorney general filed a request on Friday
to lead a class action lawsuit against JPMorgan currently being brought by US pension funds who own the bank's shares, claiming they were given "false and misleading information" about the riskiness of the bank's trading activity.

Clawback

When the Wall Street firm first announced the loss at its chief investment office in May, it said it amounted to at least $2bn.

However, in its latest financial results, the bank said that it had recorded a $4.4bn loss in the second quarter of the year due to the trading position, on top of a $1.4bn loss in the first three months of the year.

That $1.4bn figure was $459m bigger than the bank had initially calculated, forcing JPMorgan to restate its first quarter results.

It also said that it expected another $700m to $1.7bn of losses from the derivatives trading, bring losses to a potential total of $7.5bn.

The bank also said it had found evidence that some traders may have been trying to hide their losses.

It blamed the restatement on the fact that "certain individuals may have been seeking to avoid showing the full amount of the losses in the portfolio during the first quarter".

Chief executive Jamie Dimon said he had closed the division of the bank responsible for the losses and moved the remainder of the trading position to its investment banking division.

Image caption
Chief executive Jamie Dimon said he thought it was "silly" to think that mistakes would never be made

The executive in charge of the closed division, Ina Drew, left the bank in May, days after the losses were announced.

Before Friday's gains, JPMorgan had lost about 15% of its market value since the losses were first announced.

Responding to questions from analysts following the release of results, Mr Dimon said: "I think it's silly for anyone in the business world to think you're not going to make mistakes."

"It is not possible in the real world. I just think the mistakes should be smaller, fewer and far between, this being an exception."

Wells Fargo

Another bank with rising shares on Friday was Wells Fargo, which was also reporting results.

It posted second-quarter net profits of $4.6bn, up 17% from the same period last year.

Its profits from mortgages were up to $2.9bn from $1.6bn last year.

Wells Fargo is the fourth-biggest US bank and the biggest mortgage lender.

The results came the day after it paid $175m to settle allegations from the Justice Department that during the housing boom, it had charged higher rates and fees to African-American and Hispanic customers.