BofA agrees to pay $1.7 billion to mortgage insurance firm MBIA, but New York plans to sue it over alleged failure to abide by a national mortgage settlement.

NEW YORK — As Bank of America Corp. pulls itself free from a swamp of mortgage liabilities, new troubles keep threatening to suck it back under.

BofA agreed to settle a big insurer's claims over faulty mortgage bonds for $1.7 billion Monday. But it found itself threatened with new legal action for failing to abide by a landmark settlement aimed at saving homeowners from foreclosure.

The Charlotte, N.C., bank said it would settle a lawsuit dating from the financial crisis with mortgage insurance specialist MBIA Inc. The insurer had been pressing BofA for more than $5 billion in damages.

MBIA had accused Countrywide Financial Corp., the high-risk Calabasas lender that BofA acquired in 2008, of obtaining insurance on mortgage securities that were stuffed full of loans with defects the insurer had not been told about.

The settlement grants BofA the right to purchase 4.9% of MBIA, and the bank agreed to provide the struggling insurer a $500-million credit line. Wall Street applauded, bidding up MBIA shares $4.46, or 45%, to $14.29, while BofA stock rose 64 cents, or 5.2%, to $12.88.

Legal settlements stemming from the financial crisis, mostly related to Countrywide's soured loans and the toxic securities they backed, have already cost Bank of America more than $40 billion.

In addition to the MBIA settlement, BofA won a partial victory Friday when New York Atty. Gen. Eric Schneiderman and Delaware Atty. Gen Beau Biden dropped their opposition to the bank's $8.5-billion proposed settlement with major investors who lost money on soured Countrywide securities.

That settlement, which also involved Bank of New York Mellon as trustee for the mortgage securities, still requires the approval of a New York state court — something FBR Capital Markets analyst Paul J. Miller said was far from certain. If it falls apart, the damages could be much higher, analysts said.

The deal with MBIA "helps Bank of America get rid of another headline, but to me the big one is the [BofA and] Bank of New York settlement," Miller said. The hearings on that settlement start May 30, but he said the judge probably won't issue a ruling until later this year.

Even as the bank buried its legal troubles with MBIA, Schneiderman came out swinging against BofA and Wells Fargo & Co. on Monday. He said the two banks "flagrantly" violated terms of the national mortgage settlement, a $25-billion deal that 49 state attorneys general and several federal agencies reached with the five largest providers of mortgage customer service.

Schneiderman's action, which he said would be filed within a few weeks, would be the first by the regulators involved to crack the whip on banks for not abiding by the mortgage settlement.

At the heart of Schneiderman's enforcement action are paperwork delays in the mind-numbing process of applying for mortgage modifications.

"If you are a homeowner facing foreclosure, time is your greatest enemy," Schneiderman said at a news conference in Manhattan. "Every day wasted waiting for a bank to respond, or for your chance to resubmit documents, is a day homeowners fall further behind, accumulate more fees and more interest. These delays often make the difference between a family staying in their home or being displaced."

One of the 339 complaints received by Schneiderman's office was filed by Joyce Harden, a retired nurse. Harden said she and her husband have tried for nearly four years to get Wells Fargo to modify the mortgage on their home in the Rockaways area of New York City.

"We have submitted documents to them over and over again, and often we have gotten no response," Harden said, complaining that last week, without explanation, the bank prompted the couple to restart their application. "We are getting deeper and deeper into a hole."

Wells Fargo declined to comment.

A BofA spokesman said the bank had provided more than $1 billion in relief for more than 10,000 New York homeowners through March under the settlement. The bank takes the matter seriously and will work quickly to address the 129 complaints by BofA customers cited by Schneiderman, according to BofA.

"This agreement has been good for New York, and we continue using these beneficial programs to assist troubled homeowners in New York and nationally," Bank of America said.

Other parties to the agreement were JPMorgan Chase & Co., Citigroup Inc. and Ally Financial Inc., but Schneiderman declined to say how well those servicers were abiding by the agreement. "We're going to start with these two," Schneiderman said, referring to BofA and Wells Fargo.

The New York attorney general grabbed the spotlight ahead of the release of a comprehensive report next month by Joseph A. Smith Jr., the monitor overseeing the settlement.

Other attorneys general and regulators could take their own actions after Smith's report.