In a sign that the U.S. banking sector's problems are far from over, lenders including Bank of America Corp reported falling bond trading revenue and mortgage lending weakness in the fourth quarter.

Stock investors shrugged off some of the problems and focused on banks' improving credit quality, and shares of many major banks outperformed the broader market.

But bond investors were much gloomier, focusing on still-weak credit conditions and lenders' shrinking loan books, both of which could weigh on future profits.

Bank of America, the largest U.S. bank by assets, posted a $993 million loss from its home loan and insurance segment, a much wider loss than in the same quarter last year.

Wells Fargo & Co , the fourth-largest U.S. bank, made fewer home loans during the quarter compared with the third quarter and posted an eye-popping 22 percent increase in bad mortgage loans, although it still managed to wrench higher fee income out of mortgage origination.

Even U.S. Bancorp , one of the healthiest of the major U.S. banks, posted a 21 percent decline in quarterly mortgage banking revenue from the third quarter and wrote off home loans at an accelerating pace.

There's no question that there's still an issue here, said Blake Howells, director of equity research at Becker Capital in Portland, Oregon. Howells sees future mortgage losses as depressing future earnings, but not threatening banks' existence.

BANK OF AMERICA

Bank of America posted a quarterly loss of $194 million. After preferred stock dividends and charges linked to buying back preferreds from the U.S. government, the bank lost $5.2 billion, or 60 cents a share.

That compared with a year-earlier quarterly shareholder loss of $2.4 billion, or 48 cents per share. Analysts' average forecast was for a loss of 52 cents per share, according to Thomson Reuters I/B/E/S.

Despite the loss, the Charlotte, North Carolina-based bank said credit was beginning to stabilize. While it set aside $10.1 billion in the quarter for credit losses, that provision was down 14 percent from the third quarter.

We are approaching some sort of normality, said Mal Polley, chief investment officer of Stewart Capital Advisors. Charge-offs will still be high, but it has definitely stabilized.

Net income in Bank of America's global markets unit was $1.2 billion, compared with a net loss of $3.7 billion a year earlier. The bank cited a more favorable trading environment and the acquisition of Merrill Lynch & Co a year ago.

Fixed-income, currency, and commodities trading revenue fell nearly 70 percent from the third quarter.

The Merrill acquisition also bolstered the global wealth and investment management unit, where net income more than doubled to $1.3 billion.

That unit booked a $1.1 billion gain on the nearly 50 percent stake of BlackRock Inc that it owns. BlackRock bought Barclays' asset management arm in the fourth quarter, allowing Bank of America to revalue its stake.

Integrating Merrill Lynch businesses is one of the myriad challenges faced by Bank of America's new chief executive, Brian Moynihan.

Bank of America shares rose 17 cents to close at $16.49.

WELLS

Wells Fargo posted a fourth-quarter profit of $2.82 billion. After charges linked to buying back preferred shares from the U.S. government, shareholder profit was $394 million, or 8 cents per share. Analysts on average had expected a loss of 1 cent per share, according to Thomson Reuters I/B/E/S.

Chief Financial Officer Howard Atkins said losses from the San Francisco bank's takeover a year ago of Wachovia Corp, which had been stricken by mortgage losses, are tracking better than originally estimated at the time of the merger.

But the bank is still dealing with high credit losses in its commercial and residential mortgage books.

Consumer and commercial real estate losses have yet to peak, but the other portfolios are doing pretty well, Chief Financial Officer Howard Atkins told Reuters in an interview.

Wells Fargo's shares fell 46 cents, or 1.6 percent, to $27.82, underperforming the broader market as investors fretted about its nonperforming mortgages. The broader market, as measured by the Standard & Poor's 500 index <.SPX>, fell 1.1 percent.

Meanwhile, Minneapolis-based U.S. Bancorp said fourth-quarter profit nearly doubled to $602 million, or 30 cents per share.

Loan growth was aided by acquisitions in 2008 and 2009 of failed banks in California and Illinois, in transactions assisted by the Federal Deposit Insurance Corp.

U.S. Bancorp shares were up 52 cents, or 2.12 percent, to $25.01.

In December, Bank of America repaid $45 billion of government bailout money it had taken from the Troubled Asset Relief Program, part of a wave of repayments by the country's biggest banks. Wells Fargo repaid $25 billion, while U.S. Bancorp repaid $6.6 billion earlier in 2009.

(Reporting by Joe Rauch in Charlotte, N.C. and Elinor Comlay in New York; writing by Christian Plumb and Dan Wilchins; editing by John Wallace, Gerald E. McCormick and Steve Orlofsky)