The deal, announced Wednesday, comes after a group of 22 investors demanded that the Charlotte, N.C. bank repurchase $47 billion in mortgages that its Countrywide unit sold to them in the form of bonds.
The group, which includes the Federal Reserve Bank of New York, Pimco Investment Management, and Blackrock Financial Management, argued that Countrywide enriched itself at the expense of investors by continuing to service bad loans while running up servicing fees.
Bank of America, which bought Countrywide in 2008 for $4 billion, has denied those claims.
Bank of America CEO Brian Moynihan said Wednesday that the settlement would minimize "future economic uncertainty" in the banking business and "clean up the mortgage issues largely stemming from our purchase of Countrywide."
The settlement is subject to court approval and covers 530 trusts with original principal balance of $424 billion.
Citi analyst Keith Horowitz said the settlement, which amounts to only 2 percent of the original principal balance, removes one of the largest investor risks for Bank of America.
As a result of the settlement, Bank of America put its second-quarter loss at $8.6 billion to $9.1 billion. Excluding the settlement and other charges, the bank expects to post a quarterly loss of $3.2 billion to $3.7 billion.
Shares of Bank of America Corp. jumped more than 4 percent, or 48 cents to $11.30 before the market opened, with investors happy that the bank can put very big uncertainty behind it.
Investors may now be more confident that they can get similar concessions from other major U.S. banks that created markets for mortgage-backed securities with questionable pedigrees.
Yet stocks in the financial sector were rising in electronic trading Wednesday, likely because the Bank of America deal presents a framework for others to follow.