Bank of America (BAC) inked a $9.5 billion settlement on Wednesday with the Federal Housing Finance Agency to resolve all of the bank’s residential mortgage-backed securities litigation with the regulator.

BofA also reached a settlement with New York Attorney General Eric Schneiderman over the bank's disclosure policies surrounding the 2008 acquisition of Merrill Lynch.

The deals mark the latest effort by BofA to put to bed the onslaught of litigation the No. 2 U.S. bank by assets faced related to alleged wrongdoing leading up to the subprime bust and financial crisis.

The FHFA settlement resolves four lawsuits the regulator filed against BofA and its Countrywide and Merrill Lynch subsidiaries beginning in September 2011 that alleged they falsely misrepresented that underlying mortgage loans complied with certain standards.  

The agreement covers $57.5 billion of private-label RMBS bought by Fannie Mae and Freddie Mac.

Under terms of the deal, BofA agreed to make cash payments of about $6.3 billion to Fannie Mae and Freddie Mac as well as to purchase certain RMBS at fair market value, or about $3.2 billion.

In return, the FHFA agreed to dismiss pending lawsuits and release BofA and its affiliates from all securities law and fraud claims.

Charlotte-based BofA said the settlement is expected to cut its first-quarter pretax income by about $3.7 billion, or 21 cents per share after taxes.

“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,” FHFA Director Melvin Watt said in a statement.

The FHFA said it has claims remaining in seven suits against various institutions out of the 18 lawsuits it filed in 2011.

Thanks to the FHFA settlement, BofA said it has now resolved 88% of the unpaid principal balance of all RMBS where RMBS securities litigation has been filed or threatened.

BofA also said it has reached an agreement to resolve a 2010 lawsuit brought by the New York Attorney General that alleged a failure to disclose losses at Merrill Lynch prior to the company’s acquisition of the Wall Street giant in 2008.

The bank said it has agreed to pay $15 million to settle the NY AG’s claims against it, which reflects the cost of the investigation and litigation, as well as to adopt certain corporate governance changes.

Schneiderman said the deal also includes a $10 million payment by former BofA CEO Kenneth Lewis, who the NY AG alleged misrepresented the impact of the merger on the bank's results. Lewis was also hit by a three-year ban from serving as an officer or director of a public company.

“Since I took office, I’ve acted on the belief that no one, no matter how rich or powerful, should escape accountability for their actions -- especially ones that caused such damage to shareholders,” Schneiderman said in a statement.

At the same time, BofA said it has had preliminary discussions about a preliminary settlement related to investigations by the RMBS Working Group of Financial Fraud Enforcement Task Force, which includes the Department of Justice and various state attorneys general.

Also on the regulatory front, BofA said the Federal Reserve blessed its plan to hike its dividend to 5 cents per share in the second quarter and authorize a $4 billion stock buyback program.

Shares of BofA ticked up 0.47% to $17.26 in extended trading Wednesday evening.

Follow Matt Egan on Twitter @MattMEgan5