Bank of America’s second-quarter earnings were hit by litigation expenses, even as the bank continues talks with the U.S. Justice Department over a mortgage-securities settlement.

The Charlotte, N.C.-based bank earned $2 billion or 19 cents a share in the second quarter, compared to $3.6 billion or 32 cents a share a year ago.

It recorded legal expenses of $4 billion US in the quarter, most of them related to the subprime mortgage crisis of 2008, which brought down the U.S. banking system.

Bank of America, one of the world’s largest banks with 49 million customers, reached a $650-million settlement with insurance company American International Group Inc. over mortgage-backed securities on July 15.

It agreed in March to a $9.33-billion settlement with federal housing agencies Fannie Mae and Freddie Mac over selling them mortgage securities.

And it is still in negotiations with the Justice Department to avert criminal charges over its sale of the securities. U.S. banks have been paying big settlements, including $7 billion by Citigroup and $13 billion by J.PMorgan.

The Wall Street Journal reports Bank of America offered to pay $13 billion, but justice officials have asked for more.

Still talking to justice officials

"We feel like we've gotten a large chunk of this behind us ...Clearly, the DOJ is the most significant matter that's out there remaining," chief financial officer Bruce Thompson said on a call with reporters.

The bank is also racing to meet new Basel III capital rules, including a boost in capital after it discovered it had incorrectly valued securities that it had obtained through its acquisition of Merrill Lynch in 2009.

That change forced the bank to shelve a plan buy $4 billion of its own stock and raise its dividend from a penny per share to 5 cents per share

However, Thompson said revenues at the bank were improving, with increases in consumer and business banking and fewer loan defaults. Revenue fell four per cent to $21.9 billion from $22.9 billion.

With files from the Associated Press