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.