Also, Citigroup earned $3 billion in the second quarter, a much stronger result than losses forecast by analysts.
Bank of America's profit of $2.42 billion, or 33 cents per share, beat Wall Street forecasts. Analysts had expected the bank to earn 28 cents per share.
The company, like Goldman Sachs Group Inc. and JPMorgan Chase & Co., said it had a handsome profit from its trading business. The company acquired Merrill Lynch & Co. this year.
But, like JPMorgan Chase, it did report continuing losses from failed loans. Bank of America said recorded a $13.4 billion provision for loan losses during the second quarter.
Bank of America said its mortgage revenue rose following its acquisition of lender Countrywide Financial Corp.