Bank of America posts earnings of 45 cents a share vs 36 cents estimate

BAC posts better-than-expected results
Bank of America's profit more than doubles
Is the US banking sector healthy?

Bank of America reported quarterly earnings that beat analysts' expectations on Wednesday, helped by lower legal costs.

After the earnings announcement, the company's shares rose in premarket trading. (Click here to track its shares.)

Bank of America's quarterly profit more than doubled from the same period last year, when earnings were hit by big legal bills.

Net income attributable to shareholders rose to $4.99 billion, or 45 cents per share, in the three months ended June 30, from $2.04 billion, or 19 cents per share, a year earlier.

The year-earlier results were dragged down by $4 billion of legal expenses linked to mortgage disputes stemming from the financial crisis.

Litigation expenses fell to $175 million in the latest quarter.

Revenue increased to $22.12 billion from $21.96 billion a year ago.

Bank of America was forecast to deliver earnings of 36 cents per share on $21.32 billion in revenue, according to a consensus estimate from Thomson Reuters.

BofA has paid at least $70 billion to settle legal issues related to the financial crisis, undermining cost-cutting initiatives introduced by Chief Executive Brian Moynihan after he assumed the top job in 2010.

Read MoreTechnology's quest to provide an answer to the ultimate earnings call question

Analysts on average had expected earnings of 36 cents per share, according to Thomson Reuters I/B/E/S. It was not immediately clear if the reported figures were comparable.

"We also benefited from the improvement in the U.S. economy, where we are particularly well positioned," Moynihan said in a statement.

The bank's non-interest expenses fell 25.5 percent to $13.82 billion, while net interest income rose 4.7 percent to $10.49 billion. Overall revenue, excluding adjustments, rose 1.7 percent to $22.12 billion.

Bank of America earnings follow an earnings beat by JPMorgan Chase on Tuesday. On the same day, Wells Fargo matched earnings forecasts.

Reuters contributed to this report.