Mark Lennihan, Associated Press
In this photo taken, Monday, July 13, 2015, customers use ATMs at a branch office of Bank of America in New York. The bank reports quarterly earnings Wednesday, July 15, 2015.

NEW YORK — Bank of America says its profits more than doubled in the second quarter, helped by lower legal costs subsided and improvements in some of the bank's debt holdings.

The consumer banking giant earned $4.99 billion after payments to preferred shareholders. That compares to a profit of $2.04 billion a year earlier. The bank earned 45 cents per share, compared with 19 cents per share a year earlier.

Financial analysts surveyed by FactSet expected 36 cents per share, which typically exclude one-time items. Net revenue at the bank totaled $22.1 billion, compared with $21.75 billion in the same period a year earlier.

BofA's legal costs plummeted this quarter, from $4 billion to $175 million.

Shares of Bank of America rose nearly 3 percent in pre-market trading.