Bank of America Corp reported a third-quarter profit, helped by accounting gains and asset sales, though the bank's main businesses showed signs of weakness as lending profit fell and expenses rose.

The accounting gains and asset sales offset a 15 percent drop in loan income. The bank, whose investment banking unit posted a loss, also ceded its rank as the largest U.S. bank by assets to JPMorgan Chase & Co, falling to No. 2.

Revenue increased, however, and Bank of America shares rose 4.5 percent in early trading on Tuesday after having lost more than half their value this year.

Earnings were very good -- surprisingly good -- especially the revenue, surprisingly good in a very tough quarter, said Tim Ghriskey, chief investment officer at Solaris Asset Management in Bedford Hills, New York.

Chief Executive Brian Moynihan is under pressure to prove that he is turning around the Charlotte, North Carolina-based bank, which has been besieged by mortgage losses and lawsuits.

Moynihan has secured a $5 billion investment from Warren Buffett's Berkshire Hathaway Inc, is selling a variety of assets, and plans to slash 30,000 jobs over the next few years.

But many shareholders remain unconvinced about his ability to succeed. The bank also has faced a backlash for its plan to charge customers $5 per month to use debit cards.

ONE-TIME GAINS

Quarterly net income for shareholders was $5.89 billion, or 56 cents per share, compared with a loss of $7.65 billion, or 77 cents per share, a year earlier when it took a $10.4 billion accounting charge. Revenue rose 6 percent to $28.7 billion.

Bank of America recorded $9.8 billion of pretax benefits from the sale of shares in China Construction Bank Corp and two accounting gains.

It also took a $2.2 billion pretax loss for private equity and strategic investments.

The headline numbers are dramatically different than reality, said Matt McCormick, portfolio manager at Bahl & Gaynor Investment Counsel. I think it would have been flat at best without the adjustments.

Net interest income, or what the bank makes on loan interest, fell to $10.7 billion from $12.7 billion.

Net interest margin, or what the bank makes in loan interest versus what it pays for deposits, shrank to 2.32 percent from 2.72 percent.

Other major banks such as JPMorgan Chase & Co and Wells Fargo & Co also posted shrinking margins.

I'm not very pleased with the results, said Bill Hassiepen, senior analyst at credit rating agency Egan-Jones Ratings Co. Core earnings appear very suspect.

Noninterest expense climbed 4.7 percent to $17.6 billion, while total employment increased by about 2,700 to 290,509.

Chief Financial Officer Bruce Thompson said on a conference call that the second phase of the bank's efficiency plan, known as Project New BAC, would begin this month.

MORTGAGES WEIGH

The overhang from Bank of America's mortgage exposure persisted, as the mortgage unit lost $1.1 billion in the quarter, nearly triple the $392 million loss a year ago.

That unit recorded $500 million of pretax litigation expenses. And despite a boom in home refinancings, the bank originated just $33 billion of home loans, down from $40.4 billion in the preceding quarter and $71.9 billion a year earlier.

Thompson said the bank expected to continue selling pieces of its mortgage servicing rights, and should finish shedding its correspondent mortgage business by year end.

Investment banking was also weak as global dealmaking dried up. Bank of America's global bank and markets unit lost $302 million, compared with a $1.47 billion profit a year ago, as revenue from trading and investment banking fees declined.

The unit comprises much of Merrill Lynch & Co's former operations that Bank of America bought at the height of the 2008 global financial crisis.

It had been a key source of profit as other businesses, including mortgages, hemorrhaged money.

Late on Monday, Bank of America moved to disqualify the law firm representing American International Group Inc in its $10 billion mortgage fraud lawsuit against the bank, citing an alleged conflict of interest by one of the firm's lawyers, who it said once represented Merrill.

Bank of America shares were up about 4.5 percent at $6.30 in early trading.

(Reporting by Rick Rothacker and Joe Rauch in Charlotte, North Carolina; Additional reporting by Edward Krudy and Jonathan Stempel in New York; Editing by Derek Caney, John Wallace and Ted Kerr)