JP Morgan Chase & Co. said Friday it earned nearly as much in the second quarter as it had earned in the year-earlier period, as a much-publicized derivatives trading loss barely dented earnings for the largest U.S. commercial bank by assets.

Net income was $4.96 billion, or $1.21 a share, compared with $5.43 billion, or $1.27 a share, in the second quarter of last year, the New York bank said. The now-notorious loss inflicted by a London trading team led by a banker nicknamed the whale, cut earnings per share by 69 cents.

Shares rose in premarket trading 59 cents to $34.04.