Big banks beat expectations, but ...

banks
Big banks released quarterly results this week. Morgan Stanley was a winner, while Citigroup fell short.

Investors got a peek inside the nation's biggest banks this week. And the picture wasn't too bad -- as long as you don't look too closely.

For the final three months of 2013, five of the six largest U.S. banks reported earnings that were better than analysts had expected. But underlying profits were hurt in several cases by legal expenses, sluggish mortgage activity and lackluster trading. Overall revenue fell in many cases.

JPMorgan Chase (JPM) and Morgan Stanley (MVNR) both reported hefty legal hits that dragged profits lower. Excluding those costs and other one-time items, earnings at both banks topped analyst expectations.

Echoing comments by JPMorgan chief executive Jamie Dimon, Morgan Stanley CEO James Gorman said Friday that his bank is "continuing to address many of the legal issues from the financial crisis."

Related: JPMorgan earns $5.3 billion despite legal woes

Wells Fargo (WFC), the nation's largest home lender, was also hurt by weakness in the mortgage market as rising interest rates deterred borrowers.

But earnings at Bank of America (BAC) came in better than expected, helped by a $2 billion profit in the company's consumer banking division, which includes branch banking and loans for small business.

Unlike its main rivals, BofA has yet to settle with the Federal Housing Finance Agency over allegations that it misled investors about the quality of mortgage-backed securities sold prior to the financial crisis. CEO Brian Moynihan seemed to allude to this by saying "work remains on past issues."

Why big banks are too big to jail
Why big banks are too big to jail

BofA and JPMorgan both benefited from an improvement in overall credit quality, which allowed them to set aside less money for losses on bad loans.

Meanwhile, earnings at Goldman Sachs (GS) plunged 19% in the quarter, but still topped expectations.

Related: Earnings down at Goldman Sachs but still beat forecasts

Goldman, which was the lead banker on Twitter's (TWTR) IPO in November, said fees from stock underwriting more than doubled to $622 million.

The firm's trading business rebounded in the fourth quarter, which eased some concerns about the impact of new regulations that impose limits on certain risky trading strategies. Revenue from fixed income, commodities, and currency trading fell 15% in the fourth quarter from a year ago. But it was up 38% from the third quarter.

Despite the rebound in trading late last year, the amount of money Goldman spent on benefits, salaries and bonuses fell in 2013.

But compensation was up at Morgan Stanley from a year ago. Morgan Stanley reported a big jump in revenue from underwriting thanks to last year's robust IPO market. The company's wealth management and brokerage businesses were strong as well, due to the bull market in stocks. But revenue from fixed-income and commodities trading fell to $694 million from $811 million a year ago.

Citigroup (C) was the big disappointment. The bank's earnings fell short of analysts' expectations, due largely to the slowdown in mortgage financing. Shares of Citi are down sharply for the week.

CNNMoney Sponsors