The New York Attorney General’s Office said Wednesday it is suing Wells Fargo (WFC), the largest U.S. mortgage lender, to force the bank into compliance with the 2012 national mortgage settlement.

Attorney General Eric Schneiderman also announced that Bank of America (BAC) has agreed to beef up its compliance measures to better meet the requirements agreed upon as part of last year’s settlement.

“While we have brought much needed relief to thousands of New Yorkers, too many homeowners in our state are facing unnecessary challenges as they fight to keep their homes,” Schneiderman said in a statement.

“While Bank of America has chosen to work with us to take the steps required to adhere to their commitments, Wells Fargo has taken a different path. Both of these cases should send a strong message that the big banks must comply with the legally binding Servicing Standards negotiated in the National Mortgage Settlement, or face the consequences,” said Schneiderman.

Tom Goyda, a spokesman for Wells Fargo, called the lawsuit “very disappointing” and disputed Schneiderman’s claim that the bank had not complied with the terms of the national settlement.

Goyda said Wells Fargo has completed 880,000 loan modifications in the U.S. since the beginning of 2009, and 26,000 in New York state in that time. He said Wells Fargo would prefer “a collaborative approach” to fulfilling the terms of the settlement “rather than protracted litigation.”

In the wake of the 2008 financial crisis and the collapse of the U.S. housing market, many of the biggest   U.S. mortgage lenders were accused of mishandling huge numbers of home loans by “robo-signing” foreclosure documents and refusing to negotiate in good faith with borrowers seeking loan modifications. The result was thousands or more homeowners allegedly forced into foreclosure and out of their homes.

Under pressure from the U.S. government and state attorneys general offices, five of the biggest lenders – Wells Fargo, Bank of America, Ally Bank, JPMorgan Chase (JPM) and Citigroup (C) – reached a $25 billion settlement and agreed to reform their home lending practices.

Among the reforms included in the settlement were: banks are prohibited from pursuing foreclosures while negotiating loan modifications; lenders must acknowledge refinancing applications in writing within three business days; banks must notify borrowers of missing documents within five days and make decisions on complete applications within 30 days.

Wells Fargo’s shares were down 33 cents, or 0.80%, at $41.16 in late trading on the New York Stock Exchange.

Follow Dunstan Prial on Twitter @DunstanPrial