Bank of America Corp posted a better-than-expected first-quarter earnings on Thursday as the No. 2 U.S. bank set aside less money for loan losses and capital markets activity rebounded.

The bank, like rivals including JPMorgan Chase & Co and Citigroup Inc, benefited from signs of strength in the U.S. economy and more activity in the capital markets as fears about the European debt crisis eased.

The results showed Bank of America making further progress in recovering from mortgage-related losses it racked up during the financial crisis. Executives said the bank was building capital faster than expected and raised their outlook for year-end capital measures required under new international standards.

Bank of America said its first-quarter provision for expected losses from bad loans fell to the lowest level since the third quarter of 2007. Sales and trading revenue, excluding an accounting charge, was the highest since the 2008 acquisition of Merrill Lynch.

In general, it shows nice improvement across the board, said Joe Terril, president of Terril & Co. I think the thing I am most pleased with just at first glance is continued improvement in the loan portfolio.

Bank of America shares rose as high as $9.16 in early trading on the New York Stock Exchange but then fell back. They were up 5 cents to $8.97 at mid-morning.

The shares are up 60 percent this year after falling 58 percent in 2011. The bank passed the Federal Reserve's latest stress test in March, shifting investor concerns from its capital needs to its ability to increase earnings in a time of low interest rates and increased regulation.

Separately on Thursday, Morgan Stanley also reported better-than-expected results, helped by strong trading revenue.

ACCOUNTING CHARGE

Bank of America's first-quarter net income was $653 million, or 3 cents a share, down from $2.05 billion, or 17 cents per share, a year earlier.

Revenue declined to $22.3 billion from $26.9 billion.

The bank reported charges of $4.8 billion related to changes in the value of its debt, partially offset by gains of $2.8 billion from equity investments and debt-related transactions.

Excluding debt valuation adjustments, earnings were 31 cents a share.

Analysts' average estimate was 12 cents per share, according to Thomson Reuters I/B/E/S. The bank said analysts typically do not include debt valuation adjustments in their estimates.

The Charlotte, North Carolina-based bank took a loan-loss provision of $2.4 billion, compared with $3.8 billion a year ago.

In its capital markets operations, Bank of America reported sales and trading revenue of $3.8 billion, up from $1.5 billion in the fourth quarter but down from $4.6 billion a year ago.

The bank's Tier 1 common equity ratio -- comparing its core equity capital to its risk-weighted assets -- rose to 10.78 percent from 9.68 percent in the fourth quarter as it issued shares to employees, shed assets and accumulated earnings.

Chief Financial Officer Bruce Thompson said in a conference call with analysts that the bank expects to have a Tier 1 common equity ratio of more than 7.5 percent by yearend under so-called Basel III rules, up from its previous estimate of 7.25 percent to 7.5 percent.

With revenue harder to come by, Bank of America CEO Brian Moynihan is looking to cut costs to boost profits. The bank last year launched a cost-cutting program called Project New BAC that is expected to eliminate 30,000 jobs in consumer and technology areas over the next few years and reduce annual expenses by $5 billion.

In the conference call with analysts, Thompson said the bank expects to wrap up plans for the second phase of New BAC in May. That segment - focusing on capital markets, wealth management and commercial banking - is expected to produce a smaller reduction in expenses and jobs because these businesses are more efficient and have fewer employees.

First-quarter expenses fell 5.6 percent to $19.1 billion.

We will continue to streamline our company, Moynihan said in the call.

(Reporting By Rick Rothacker in Charlotte, North Carolina; Additional reporting by Ilaina Jonas; Editing Maureen Bavdek and John Wallace)