Litigation expenses and debt valuation adjustments cut into Bank of America's (BAC) revenue in the third quarter, pushing the financial firm to a modest profit of $340 million.

Earnings per share hit zero, highlighting how much money the company bled as it struggled to resolve ongoing litigation and deal with $1.9 billion in debt valuation adjustments during the same period. 

Last quarter, BofA beat analyst expectations for its earnings, with $22.2 billion in revenue, but missed revenue forecasts.

Still, the average analyst was calling for a loss of 7 cents per share, so breaking evening was a better-than-expected outcome for the mega bank.

BofA said in the third-quarter alone it took a $1.6 billion hit to cover litigation expenses. The litigation expenses included a major $2 billion-plus settlement with BofA shareholders who sued the company for misleading investors about BofA's acquisition of Merrill Lynch in the wake of the financial crisis.

The company's third-quarter income is billions of dollars below year ago levels. Last year, BofA reported income of $6.2 billion, or 56 cents per share. That figure stands in stark contrast to the $340 million in profit this quarter.