Bank of America has agreed to pay American International Group $650 million to settle their disputes over residential mortgage-backed securities.

The settlement, announced Wednesday, ends lawsuits filed by AIG against Bank of America in New York and California federal courts. The suits accuse Bank of America of misrepresenting the quality of the loans underlying securities it sold.

As part of the deal, AIG has agreed to drop its opposition to an $8.5 billion settlement with a group of institutional investors, including AIG. That suit concerns Bank of America’s liability for the investors’ losses from securities backed by mortgages issued by Countrywide Financial, which Bank of America acquired in 2008.

The trustee for the investors agreed to the $8.5 billion settlement in that case in 2011, but a group of investors led by AIG opposed it, claiming that Bank of America was liable for $30 to $35 billion. In January, then-Manhattan Supreme Court Justice Barbara Kapnick declined to stay enforcement of the settlement, but AIG appealed (NYLJ, Feb. 21).

Under the newly announced settlement, AIG will get its share of the Countrywide settlement in addition to the $650 million.

Bank of America said in an investor release that it has now settled about 95 percent of the unpaid principal balance of mortgage-backed securities that had given rise to litigation or threats of litigation.

The Countrywide case is In re Bank of New York Mellon, 651786/11.