BofALogo_Oct2014
The Bank of America building is shown in Los Angeles on Oct. 29, 2014. Reuters/Mike Blake

(Reuters) - Bank of America Corp, the No. 2 U.S. bank by assets, reported a first-quarter profit of $2.98 billion, compared with a surprise loss a year earlier when it took a charge of $6 billion for litigation expenses.

BofA reported net income attributable to common shareholders of 27 cents per share for the quarter ended March 31, compared with a loss of 5 cents per share a year earlier.

The results included a charge of 6 cents per share in annual retirement incentive costs and a 3-cent charge for market-related net interest income adjustments.

Analysts on average had expected earnings of 29 cents per share, according to Thomson Reuters I/B/E/S.

It was not immediately clear if the figures reported on Wednesday were comparable.