New York Attorney General Eric Schneiderman on Monday threatened to sue Bank of America and Wells Fargo for allegedly failing to help struggling homeowners under the $25 billion national mortgage settlement.

Schneiderman was one of 49 attorneys general to negotiate the sweeping deal with the nation’s five largest mortgage servicers over foreclosure abuses last year. If the banks do not comply, Schneiderman said, he will file suit and ask for a court injunction.

New York’s top prosecutor said he received 339 complaints that the behemoth banks were dragging their feet in processing requests from homeowners to have their loan payments lowered — a direct violation of the settlement. The banks allegedly failed to respond to requests from borrowers to have their mortgage balance or interest rates reduced within the 30 days allotted in the settlement, and some borrowers weren’t allowed to submit missing documentation.

“Wells Fargo and Bank of America have flagrantly violated those obligations, putting hundreds of homeowners across New York at greater risk of foreclosure,” Schneider­man said in a statement. “I intend to use every tool available to my office to hold these companies accountable.”

The settlement was brought on by revelations that mortgage servicers were using forged and shoddy paperwork to quickly foreclose on struggling homeowners, a practice known as “robo-signing.”

As of December, more than half a million homeowners have received some $46 billion worth of loan modifications, short sales, refinancing and forbearance as part of the deal, according to the latest report from the court-appointed monitor of the settlement.

“There are areas in which the banks must improve their treatment of their customers,” said Joe Smith, monitor of the settlement. He added that his office plans to release a report on the lenders’ compliance in June.

Advocacy groups have grown weary of the settlement. At the time the deal was reached, consumer advocates were pleased that it included extensive servicing standards to prevent a repeat of the types of abusive foreclosure practices that ran rampant during the housing crisis. But within months of the agreement, housing counselors started to receive complaints that servicers were back to their old behavior.

A survey in April of 85 housing counselors in California, representing hundreds of thousands of borrowers, revealed claims that banks are violating consumer-protection provisions in the settlement.

About 70 percent of the counselors told researchers at the California Reinvestment Coalition that the single points of contact that banks provided were rarely accessible or knowledgeable. Sixty percent of counselors said the banks rarely made modification decisions within 30 days of a submitted application.

In New York, the attorney general’s office said it was flooded with complaints that Bank of America and Wells Fargo were not responding to modification requests in a timely manner. By the end of April, the prosecutor’s office documented 210 violations by Wells Fargo and 129 by Bank of America.

“We have many clients who are at risk of losing their homes to foreclosure simply because Wells Fargo failed to properly review complete loan-modification packages sitting in their office for months,” said Megan Faux, acting director of the Brooklyn branch of Legal Services NYC. “Accountability to the servicing standards is essential to ensuring homeowners have a fair opportunity to negotiate an affordable mortgage . . . .”

Responding to the allegations, Wells Fargo spokeswoman Vickee J. Adams said the bank is “committed to full compliance.”

“It is unfortunate that the New York attorney general has chosen this route rather than engage in a constructive dialogue through the established dispute resolution process,” she said.

Bank of America spokesman Richard Simon said the company “will work quickly to address” the servicing problems identified by the attorney general’s office. He said that through March, Bank of America has provided mortgage relief totaling more than $1 billion for more than 10,000 New York homeowners.

Schneiderman sent a letter Friday to Smith and the monitoring committee about his intentions to sue if the committee fails to rein in the banks.

It is unclear whether Schneiderman will be joined by any other state prosecutors. The offices of the attorneys general in Iowa and California, which were critical to the settlement negotiations, say they have received similar complaints from homeowners but would not confirm whether they intend to take legal action.