Bank of America settled claims made by Fannie Mae and Freddie Mac on Wednesday to the tune of $9.5 billion.

According to the Los Angeles Times, the mortgage companies wanted the bank to pay for losses that came about when the housing market collapsed.

The settlement also gets the conservator for the two mortgage companies, the Federal Housing Finance Agency, out of the North Carolina-based bank's hair.
Bank of America will pay Fannie and Freddie through $6.3 billion in cash and the rest in securities, reports Reuters. FHFA Director Mel Watt released a statement saying, "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."

Separately, BofA also settled a lawsuit from the New York Attorney General because the bank purchased Merrill Lynch & Co. back in 2009. Bank of America will pay $15 million.

The second-largest bank in the U.S. now just has to deal with the Department of Justice. The DOJ filed a suit over securities sold by Bank of America while the housing market was booming.