Bank of America, the second-largest U.S. bank by assets under management, posted better-than-expected second-quarter results on Tuesday.

The bank reported earnings per share of 46 cents on revenue of $22.829 billion. Analysts polled by Thomson Reuters expected earnings per share of 43 cents on sales of $21.781 billion.

However, the bank's stock fell 0.48 percent after reporting a slump in its trading business.

Revenue from the company's fixed income trading unit totaled $2.254 billion for the quarter, topping expectations, but still represented a 14 percent year-over-year decline. The bank attributed the decline to "weaker performance in rates and emerging markets relative to a strong year-ago quarter."

Other major banks also reported a slowdown in second-quarter trading, including JPMorgan Chase and Citigroup.

"The headline number is what looks to be a pretty solid beat. But as usual with these guys, [there are] a few moving parts. If you back out the net gains on the sale of the U.K. credit cards business and some securities gains and if you take out some reserve release, it gets me from the 46 [cents] reported number to a 43 [cents earnings per share]," Jeffery Harte, principal at Sandler O'Neill, told CNBC's "Squawk Box."

Bank of America said its global banking unit posted revenue of $5 billion, a record. Bank of America also reported net interest income of $11 billion, below a StreetAccount estimate of $11.34 billion.

Net charge-offs, a measure of costs for bad debt, decreased by 8 percent to $908 million, the bank said. Analysts polled by StreetAccount expected net charge-offs to total $975.3 million.

Here's a side-by-side comparison of Bank of America's results and Wall Street's estimates:

EPS: 46 cents vs 43 cents expected by analysts polled by Thomson Reuters.

Revenue: $22.829 billion vs $21.781 billion expected by Reuters.

Net interest income: $11 billion vs $11.34 billion expected by StreetAccount.

Fixed income trading: $2.254 billion vs $2.22 billion expected.

Net charge-offs: $908 million vs $975.3 million expected.

The bank's stock has outperformed its peers over the past six months. In that time period, Bank of America shares have risen 6.14 percent. The SPDR S&P Bank exchange-traded fund (KBE), meanwhile, has gained 2.55 percent.

BAC vs KBE, 6-month chart

Source: FactSet

Late last month, the bank hiked its annual dividend to 48 cents a share, or 12 cents per quarter. The increase gave way for Warren Buffett's Berkshire Hathaway to become the bank's largest shareholder. Berkshire has warrants to buy 700 million common shares of Bank of America at $7.14 each.

Also last month, Bank of America started to lay off employees in its operations and technology division. The cuts came as the bank tries to reduce costs to boost financial targets set by CEO Brian Moynihan.

Bank of America is the latest big U.S. bank to report quarterly results. JPMorgan Chase, Citigroup and Wells Fargo all reported last week. Their results beat expectations. Goldman Sachs also reported quarterly results that beat expectations on Tuesday.