J.P. Morgan Chase

(JPM) - Get Report

, weighed down by a hefty litigation charge, still managed to post better-than-expected earnings in the second quarter, reversing a year-ago loss.

In the quarter, the nation's third-largest bank earned $994 million, or 28 cents a share, compared with a year-ago loss of $500 million, or 27 cents a share. Net revenue at the New York-based bank was $12.7 billion, up 48% because of the impact of last year's merger with

Bank One

.

The second quarter included a previously announced $1.9 billion charge stemming from the bank's $2.2 billion settlement with shareholders in the

Enron

class action. The year-ago quarter included an even larger $3.7 billion litigation charge.

Excluding the $1.9 billion charge, J.P. Morgan earned 66 cents a share, which exceeded the Thomson Financial consensus estimate by two pennies.

Analysts were expecting revenue of $13.4 billion, slightly higher than the reported figure. But on an operating basis, the bank said revenue was $13.9 billion. Either way, revenue was down about 7% from the first quarter of this year.

The weakest division was investment banking, which reported earnings of $606 million, down 6% from a year ago. Poor trading revenue was attributed for much of the decline. The bank reported a 50% slide in trading revenue to $614 million.

On the bright side, investment banking fees were up 8% to $965 million.

Earlier this summer, J.P. Morgan warned Wall Street to expect poor trading numbers, especially from its fixed-income desk. After that warning, many analysts pared back their estimates. On Monday,

Citigroup

(C) - Get Report

, the nation's largest financial services firm, served up disappointing earnings, also mainly because of the poor performance of its bond trading desk.

Other areas of the bank performed relatively well, especially when factoring in the revenue boost from the Bank One merger.

Credit card revenue was $1 billion, up 219% from a year ago. Asset management commissions and fees totaled $2.5 billion, up 40%. Interest income -- revenue from the bank's lending operation -- was $13 billion, up 116%.

But compared to the first quarter of this year, JP Morgan's performance was often underwhelming. On a sequential basis, investment banking fees were down 3% and mortgage fees and income slid 7% to $336 million.