Bank of America, the second-largest U.S. bank by assets, agreed Wednesday to pay about 9.5 billion U.S. dollars to settle all litigation by the Federal Housing Finance Agency (FHFA) over mortgage-backed securities sold to mortgage giants Fannie Mae and Freddie Mac. The settlement resolves four lawsuits the FHFA filed against Bank of America and its affiliates Countrywide and Merrill Lynch, alleging they falsely represented that the underlying mortgage loans complied with certain standards, the bank said in a statement. The deal covers 57.5 billion dollars of private-label residential mortgage-backed securities bought by Fannie Mae and Freddie Mac between 2005 and 2007, said the bank. Under the terms of the settlement, Bank of America will make about 6.3 billion dollars in cash payments to Fannie Mae and Freddie Mac. In addition, the bank will purchase certain residential mortgage-backed securities at fair market value, worth about 3.2 billion dollars, from the mortgage giants. Bank of America said that the settlement would reduce the bank's pre-tax earnings in the first quarter by about 3.7 billion dollars. In return, the FHFA's pending lawsuits against Bank of America and its affiliates will be dismissed. "The FHFA has acted under its statutory mandate to recover losses incurred by the companies and American taxpayers and has concluded that this resolution represents a reasonable and prudent settlement of these cases," said Melvin Watt, director of the FHFA, which oversees Fannie Mae and Freddie Mac. "This settlement also represents an important step in helping restore stability to our broader mortgage market and moving to bring back the role of private firms in providing mortgage credit," he added.