Bank of America Corp posted a first-quarter loss on Wednesday as it set aside an extra $6 billion to cover litigation expenses, a figure that far exceeded the legal settlements the No. 2 U.S. bank has announced recently.

The bank reported a net loss attributable to shareholders of$514 million, or 5 cents per share, for the first-quarter ended March 31 compared with a profit of $1.11 billion, or 10 cents per share, a year earlier.

The previous quarter's results were hit by $1.6 billion in charges related to disputes with bond insurers.

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

BofA's shares, which have risen 5.3 percent so far this year, were down 0.4 percent at $16.33 in premarket trading.

Revenue fell 3.8 percent to $22.66 billion, excluding accounting adjustments, but beat the average analyst estimate of $22.33 billion.

The loss follows Bank of America's best year since before the financial crisis.

The bank's 2013 net income of $11.4 billion was the highest since 2007, but large legal bills and settlements left over from the financial crisis remain a drag on performance.

BofA made progress resolving many of its legal issues in the first quarter, although some proved to be costly.

BofA agreed in March to pay $9.5 billion to settle claims that it sold Fannie Mae and Freddie Mac faulty mortgage bonds, helping it to end one of the largest legal headaches it still faced from the crisis.

The bank also received a New York judge's approval for its $8.5 billion settlement with investors in mortgage securities that went sour.

"The cost of resolving more of our mortgage issues hurt our earnings this quarter," Chief Executive Brian Moynihan said in a statement.

EXPENSES RISE

Litigation expenses of $6 billion compared with $2.2 billion in the first quarter of 2013. Non-interest expenses increased to $22.24 billion from $19.50 billion.

Costs in the bank's Legacy Assets and Servicing division, excluding litigation expenses, fell to $1.6 billion from $2.6 billion a year earlier and $1.8 billion in the third quarter.

The Charlotte-based bank has said that costs in the unit, which handles delinquent mortgage loans, would fall below $1.1 billion a quarter by the end of 2014 and will be about $500 million a quarter by the end of 2015.

Bank of America released $379 million from its allowances for bad loans, compared with $804 million in the same period a year earlier and $1.2 billion in the fourth quarter.

Bank of America is the first of the big U.S. banks to report a loss for the quarter. Both Citigroup Inc and Wells Fargo & Co reported better-than-expected results, while JPMorgan Chase & Co missed estimates as bond trading revenue fell. Goldman Sachs Group Inc and Morgan Stanley report first-quarter results on Thursday.

BofA's net charge-off ratio fell to 0.62 percent in the quarter from 1.14 percent in the same period a year earlier.

Fee income fell on a number of fronts.

Core mortgage production revenue dropped to $273 million from $404 million in the fourth quarter and $815 million a year earlier, as fewer homeowners refinanced mortgages and a particularly cold winter discouraged prospective home buyers.

The bank extended $10.8 billion in home loans, down from $11.6 billion in the fourth quarter and $23.9 billion a year earlier. Revenue in BofA's Global Banking division rose to $4.27 billion from $4.03 billion.

In the banking industry as a whole, fee income fell 0.2 percent in the quarter, the slowest start to the year since 2012, according to Thomson Reuters Deals Business Intelligence.

Revenue from fixed income trading declined 1.7 percent to $2.95 billion as many clients took to the sidelines in the quarter, awaiting clarity from the Federal Reserve on its interest rate intentions.

Still, BofA outperformed JPMorgan Chase, whose bond trading revenue dropped 21 percent, and Citigroup, whose revenue from the business fell 18 percent.

BofA's net interest margin, excluding market-related adjustments, was 2.36 percent, compared with 2.30 percent in the first quarter of 2013.

During the quarter, the bank received the Federal Reserve's blessing to increase its quarterly dividend to 5 cents per share from 1 cent and repurchase $4 billion in common shares.

(Reporting by Peter Rudegeair in New York and Tanya Agrawal in Bangalore; Editing by Ted Kerr)