Four years after buying itself a heap of expensive problems, Bank of America (BAC) is paying dearly to move on.

But it's still not in the clear.

The second-largest bank on Friday said it would pay $2.43 billion to investors angered by its $50 billion purchase of investment bank Merrill Lynch. Bank of America agreed to buy Merrill in September 2008, at the height of the financial crisis - but hid the extent of the investment bank's problems from shareholders who voted to approve the deal, investors alleged in a lingering class action.

Those plaintiffs then watched the value of their investments tumble as Merrill's losses came to light, the lawsuit claims. On Friday, Bank of America denied the allegations and said in a press release that it had agreed to the proposed settlement to "eliminate the uncertainties, burden and expense" of continuing to fight the lawsuit.

"Resolving this litigation removes uncertainty and risk and is in the best interests of our shareholders," Chief Executive Brian Moynihan said in the release. "As we work to put these long-standing issues behind us, our primary focus is on the future."

As part of the settlement, B of A also agreed to adopt or continue certain governance practices until Jan. 1, 2015, including establishing policies for a board committee on acquisitions and conducting an annual shareholder "say-on-pay" vote on executive compensation. (Dodd-Frank mandates nonbinding shareholder votes on executive compensation at least once every three years, though shareholders get to decide periodically whether to make those votes more frequent.)

The Charlotte bank said it could partially cover the settlement from its litigation reserves, but it will also incur a $1.6 billion expense in the third quarter to pay for the rest of the settlement and other, unspecified litigation-related items.

Barclays analyst Jason Goldberg called the $2.43 billion price tag "a big settlement relative to other settlements we've seen" on similar lawsuits, but "it's another step the company takes to put the costs of the financial crisis behind it."

Moynihan, who became CEO in January 2010, has spent much of his tenure trying to mop up after the financial crisis and the big purchases his predecessor, Ken Lewis, made in 2008 and 2009. Bank of America in 2010 paid $150 million to settle Securities and Exchange Commission charges that it did not properly disclose employee bonuses and losses at Merrill, but it is still facing several outstanding lawsuits and mortgage repurchase requests stemming from another ill-fated acquisition, mortgage lender Countrywide Financial.

"The mortgage-related matters continue to be at the top of investors' minds, whether it's private-label securitization matters or putbacks," Goldberg said. "You read the 10-Q [regulatory filing] every quarter and there are pages upon pages upon pages of legal disclosures."

Bank of America faced $22.7 billion in mortgage repurchase claims at the end of the second quarter, including almost $11 billion of claims from Fannie Mae and Freddie Mac and $8.6 billion from private-label mortgage securities investors.

The bank also warned Friday that it will take a $1.9 billion pretax charge in the third quarter, to account for "negative fair-value-option adjustments and debit-valuation adjustments related to the improvement in the company's credit spreads." It had previously warned that it would also take an $800 million charge to account for changes in the U.K. corporate tax rate. Together with the litigation expenses, those charges will take 28 cents per share out of Bank of America's third-quarter results, which the bank will report on Oct. 17.

Bank of America shares had fallen about 1% at midafternoon Friday, to $8.88. But however ugly its third-quarter results are, the settlement expenses are the latest example of its slow, painful progress away from the crisis era. And Goldberg said he was pleased with "the significant strides" B of A made over the past year, when Moynihan was facing mounting worries over the bank's capital levels.

"They've made a lot more progress than we would have thought in improving their capital position," he said. "That's the first step necessary. Next is to be focused on the expense side, and ultimately they've got to restart the growth engine."

The proposed settlement has to be approved by Judge Kevin Castel in the U.S. District Court for the Southern District of New York. The case is In Re Bank of America Securities Derivative & Employment Retirement Income Sec. Act (ERISA) Litigation, 09 MDL 2058 (PKC).