Bank of America agreed to pay $9.3 billion to settle claims that it sold Fannie Mae and Freddie Mac faulty mortgage bonds, helping the bank to end one of the largest legal headaches it still faced from the financial crisis. The settlement includes $6.3 billion in cash and the rest in securities that Bank of America will purchase from the two housing finance entities. The bank said it had now resolved around 88% of its total exposure to securities at issue in the mortgage bond litigation it has faced. The bank said the settlement was expected to reduce first-quarter income by about 21 cents a share. The bank and its former chief executive, Kenneth Lewis, also settled a lawsuit by New York’s attorney general that alleged it misled investors about mounting losses at Merrill Lynch & Co, which the bank agreed to acquire at the height of the financial crisis. Lewis, who resigned in 2009, agreed to pay $10 million and be barred for three years from serving as an officer or director of a public company. Bank of America agreed to pay $15 million and adopt corporate reforms. Both payments will cover the costs of New York’s investigation, and neither Lewis nor Bank of America is admitting wrongdoing or paying damages. Bank of America still faces a lawsuit from the U.S. Justice Department and several other probes by the DOJ and states over mortgage-backed securities it sold during the housing boom.