JPMorgan Chase & Co posted a higher quarterly profit on Thursday, topping Wall Street estimates, as strength in its core consumer and investment banking businesses offset a jump in credit losses.

Second-quarter net income rose to $2.72 billion from $2 billion a year earlier, while net revenue jumped 41 percent to $27.71 billion.

Profit per share fell to 28 cents from 53 cents, due in part to an increase in shares outstanding.

The bank said it set aside $9.7 billion for credit losses, up from $4.29 billion a year earlier but down from the first quarter's $10.07 billion.

JPMorgan last month repaid $25 billion taken from the Troubled Asset Relief Program and is the largest U.S. bank to repay federal bailout money. It has said it will allow the Treasury Department to auction the attached stock warrants, rather than pay an inflated price to buy them back.

Chief Executive Jamie Dimon said in a statement that the bank felt confident that its capital, reserve levels and earnings power are solid even if the economy weakens.

Second-quarter results included per-share charges of 27 cents relating to the TARP repayment, and 10 cents to bolster a federal deposit insurance program.

Analysts on average had expected profit of 4 cents per share on revenue of $25.91 billion, according to Reuters Estimates.

JPMorgan shares closed Wednesday at $36.26 on the New York Stock Exchange. Through Wednesday, the shares had risen 15 percent this year, compared with a 14.4 percent decline in the KBW Bank Index.

(Reporting by Jonathan Stempel; editing by John Wallace)