Linda Young

Bank of America on Wednesday announced it has agreed to pay $8.5 billion to settle a dispute with investors who lost money on mortgage-backed securities.

It is the largest settlement ever for a mortgage lender and ends a nine-month battle between the bank and 22 investors who held a combined total of more than $56 billion in mortgage-backed securities in the 2008 financial crisis after the housing market bubble burst.

Among the 22 investors were Prudential Financial Inc., MetLife and the Federal Reserve Bank of New York.

The investors bought the mortgage-backed securities from Countrywide Financial, which Bank of America acquired in 2008.

Investors allege that the securities were packed with bad mortgages, which was contrary to the information the investors were given about the quality of the debt and the collateral backing it, which they were purchasing. Moreover, the investors alleged that Countrywide and Bank of America failed to keep accurate records of the loans.

Company officials say the company will post a second-quarter net loss of around $9.1 billion, or 93 cents per share, because of the payment.

A court must approve the payout before it is made.