JPMorgan Chase & Co reported better-than-expected first-quarter profit on Thursday as improved investment banking performance offset increased losses from credit cards and other consumer debt.

A deepening recession and rising unemployment forced the bank to set aside more money against losses in its consumer banking business.

But even amid economic difficulty, Chief Executive Jamie Dimon said the bank has the money to repay the $25 billion in taxpayer funds it received from the U.S. government in October.

We could pay it back tomorrow, Dimon said, adding that the bank is waiting for guidance from the government on when it can do so. Goldman Sachs Group Inc earlier this week raised $5 billion in a stock sale to help pay back the $10 billion it received from the government.

JPMorgan shares rose slightly in premarket trading after an initial decline.

You have the continuing concerns that things are still dicey for the consumer, said Michael Holland, founder of investment management firm Holland & Co in New York.

While the bank has largely avoided the losses and writedowns on complex debt securities and subprime mortgages that hurt other banks in 2008, it is heavily exposed to consumer credit. Dimon warned on Thursday that any further economic weakening could force it to set aside even more money later in the year.

Revenue from the bank's retail division was boosted by its acquisition of failed Seattle, Washington-based thrift Washington Mutual Inc last fall, as well as higher mortgage fees and a pickup in refinancing. But this unit also set aside more money against credit losses.

Profit from investment banking rose as well, helped by debt underwriting and stronger trading results in credit and emerging markets.

Dimon said it is unreasonable to expect investment banking results to remain as strong as they were in the first quarter.

Net income to JPMorgan common shareholders was $1.52 billion, or 40 cents a share, down from $2.29 billion, or 67 cents a share, a year earlier. Net income before preferred dividends was $2.14 billion, compared with $2.37 billion a year ago. Revenue increased 45 percent to $25 billion.

Analysts on average expected the second-largest U.S. bank to earn 30 cents a share, with forecasts ranging from 11 cents to 45 cents, according to Reuters Estimates.

The bank set aside $10 billion for credit losses, almost twice the amount of a year earlier.

RISING RISK

JPMorgan's trading risk, including its loan hedging portfolio, rose from both a year earlier and the 2008 fourth quarter.

Value at risk, a measure of the maximum common loss on 99 percent of trading days during the quarter, was $336 million in the first quarter, compared with $122 million a year earlier and $327 million in the fourth quarter.

The company reported investment banking profit of $1.6 billion, up from a loss of $87 million a year earlier, on an increase in debt underwriting and strong credit, emerging markets and rates trading activity.

Goldman Sachs also boosted its trading risk in the first quarter, mainly in interest-rate products like government bonds.

The increase in value at risk does not necessarily mean the banks are making bets with their own money, and may reflect the increased risk associated with holding securities in inventory for trading with customers.

JPMorgan's investment banking risk has gone down, not up, Dimon said on a call with journalists.

He also said JPMorgan could raise capital if it wanted to, adding that he does not believe any bank should be allowed to repay the government before it does.

Goldman Sachs said it would repay the government only when regulators gave it the green light.

Dimon said it has become a scarlet letter for banks to keep money received under the Troubled Asset Relief Program.

JPMorgan's ratio of tangible common equity to tangible assets, an increasingly popular measure of capital strength, was about 4.3 percent in the first quarter. That is high compared to weaker competitors, some of whom have tangible common equity ratios below 3 percent. The market is not clear about what level is ideal for this ratio, and some analysts argue banks should have ratios closer to 5 percent.

In February, JPMorgan slashed its common stock dividend 87 percent to 5 cents a share, saving $5 billion of common equity a year.

JPMorgan shares have outperformed the broader sector so far this year, rising about 3 percent through Wednesday, compared with a 20 percent decline in the KBW Bank Index.

(Reporting by Elinor Comlay; additional reporting by Dan Wilchins and Jonathan Stempel; editing by Derek Caney and John Wallace)