Bank of America announced Wednesday that it will pay $8.5 billion and set aside an additional $5.5 billion to settle claims by investors who bought toxic mortgage securities from the banking giant — marking the largest settlement yet to come from the financial crisis.

The settlement agreement, which exceeds all of Bank of America’s profits since the onset of the financial crisis in September 2008, will go to some of the bank’s most important institutional clients, including Blackrock, Pacific Investment Management Co., investment bank Goldman Sachs, the Federal Reserve Bank of New York and others that bought mortgage-backed securities between 2004 and 2008.

The deal immediately drew ire from some consumer advocates because Bank of America has yet to reach a separate settlement with state attorneys general that would help homeowners.

“We would hope that homeowners get the same sort of compensation that investors did,” said Ellen Taverna, a legislative associate at Washington-based National Association of Consumer Advocates, which has been pushing for foreclosure-prevention programs. “They should be treated the same way.”

The move by Bank of America raises the possibility that other big banks, such as Citigroup, J.P. Morgan Chase and Wells Fargo, which also originated mortgage-backed securities during the pre-recession housing boom, could reach similar settlements with investors. But Bank of America, which bought mortgage originator Countrywide Financial for $4 billion in 2008, carried by far the worst exposure to claims from investors burned by toxic securities it mass-produced, analysts said.

“J.P. Morgan, Wells Fargo, they have their own crosses to bear . . . but it’s nowhere near the burdens of Countrywide,” said Paul Miller, an analyst who covers Bank of America for FBR Capital Markets in Arlington. Miller added that other banks are likely to settle for smaller amounts.

Markets largely cheered the settlement, which removed some uncertainties about Bank of America’s future liabilities stemming from souring Countrywide mortgages. The bank’s stock ended the day up nearly 3 percent, closing at $11.14 per share. The New York Stock Exchange financial sector index, which measures the performance of large financial firms including J.P. Morgan, Citigroup, Goldman Sachs and Morgan Stanley, ended the day up 2 percent on the news of Bank of America’s settlement.

“I think it’s a net positive for Wall Street,” said Miller, the FBR analyst. “It starts to put some stuff behind it.”

The $14 billion could grow by $5 billion to settle additional mortgage-related claims, company officials said. It marks the most significant attempt yet by the bank, the United States’ largest by assets, to “put the financial crisis behind us,” chief executive Brian Moynihan said on a conference call Wednesday. This is “a major step forward for our company.”

But significant obstacles remain for Bank of America, including a settlement being pursued by a coalition of state attorneys general and federal officials over widespread problems in the foreclosure practices of big banks.

The attorneys general are seeking as much as $20 billion from the banks and mortgage lenders to create a fund that would aid struggling homeowners by reducing the principal on some loans or paying for foreclosure mitigation programs. In turn, the banks proposed paying $5 billion, a number that was dismissed by state and federal officials as too small.

None of the reserves Bank of America announced Wednesday would go toward the potential settlement being sought by the attorneys general, said Jerome Dubrowski, a spokesman for Bank of America. “This is a settlement with private investors,” he added.

But Bank of America is preparing to pay some money in that case. During a morning conference call with analysts, Bruce Thompson, the bank’s chief risk officer, said it has set aside funds to settle with the attorneys general but cautioned that it’s not “a significant amount” because the negotiations are still “a very fluid situation.”

Bank of America’s settlement with the mortgage-security investors, though more defined, also faces some hurdles. Twenty-two large institutional investors have committed to support the $8.5 billion settlement, but a judge still must approve it. The deal would apply to investors who own interests in 530 pools of mortgage-backed securities originated by Countrywide between 2004 and 2008.

The deal could be a tough sell for some investors. They are being asked to accept a settlement of $8.5 billion for their outstanding $221 billion of mortgages, or a payment of about 4 cents on each dollar.

“That just strikes me as ridiculous,” said Bill Frey, president of Connecticut-based Greenwich Financial Services, which owns some of the securities subject to the settlement.

Frey said he would oppose the settlement and hopes other investors will too. “They’re getting their shorts taken down” by Bank of America, he said. To fully compensate investors for their losses, a settlement of about $80 billion to $100 billion would be required, Frey said.

“It’s a rigged game,” he added.

But there is a silver lining for investors: they can accept the money and still bring fraud charges against Bank of America because the settlement does not release the firm from securities fraud claims.