Image copyright Getty Images Image caption Bank of America has paid $6bn in the first quarter for mortgage-related legal matters

Bank of America has posted a $276m (£165m) loss for January to March.

Its results included $6bn in legal expenses to settle allegations that it misled mortgage lenders Fannie Mae and Freddie Mac before the housing crisis in 2008, as well as for other mortgage-related matters.

Revenue declined 3% compared with the first quarter of 2013, to $22.7bn.

Nevertheless, the bank said it had "solid results" and that costs from its mortgage loans business fell by $1bn.

Earnings 'hurt'

In March, the firm agreed to pay $9.5bn (£5.7bn) to settle four lawsuits filed in 2011 by US regulatory agency, the Federal Housing Finance Authority (FHFA).

The bank agreed to pay $6.3bn in cash and buy back $3.2bn in mortgage securities from Fannie Mae and Freddie Mac.

The cash settlement ate into earnings in the first quarter, chief executive Brian Moynihan said.

"The cost of resolving more of our mortgage issues hurt our earnings this quarter," he said.

The bank's results in the fourth quarter last year were affected by a $1.6bn settlement with bond insurers.