ALBANY — The Trump Foundation has agreed to be dissolved under court supervision after being accused by New York State of violating tax, charity and election laws, Attorney General Barbara Underwood announced Tuesday.

Underwood called the development a victory in her lawsuit against the foundation, which she says was misused to settle Trump business disputes and boost his 2016 presidential campaign. A judge will oversee the foundation’s dissolution and distribute its funds to an approved list of nonprofit organizations, she said.

“Today’s stipulation accomplishes a key piece of the relief sought in our lawsuit earlier this year,” Underwood said in a statement. “Under the terms, the Trump Foundation can only dissolve under judicial supervision — and it can only distribute its remaining charitable assets to reputable organizations approved by my office.”

Trump lawyers signed off on the dissolution requirement even while continuing to fight Underwood's claims in court. Last month, a judge rejected the foundation's motion to throw out the lawsuit.

The stipulation was filed Tuesday in Manhattan with the judge overseeing the case.

The signing of the document set off another back-and-forth between Trump lawyers and Underwood over liquidation of the foundation. Trump attorneys said they've been trying to disburse the $1.7 million remaining funds but have been blocked by the attorney general. An Underwood aide said the Trump team was trying to do so without any legal oversight, which was "unacceptable" given the foundation's "pattern of illegality."

Get the Breaking News newsletter! Get the latest breaking news as it happens. By clicking Sign up, you agree to our privacy policy.

It was just the latest development in a legal fight Underwood launched in June.

Underwood sued Trump's charitable foundation, saying it engaged in "persistently illegal conduct," serving as a personal piggy bank to settle his debts and boost his 2016 Republican presidential campaign.

She alleged a string of “self-dealing” transactions executed by the foundation. These included a “$100,000 payment to settle legal claims against Mr. Trump’s Mar-a-Lago resort regarding code violations; a $158,000 payment to settle legal claims by a golfer who said Trump National Golf Club reneged a $1 million prize for a hole-in-one contest in 2008, and a $10,000 payment at a charity auction to purchase a painting of Mr. Trump at the Trump National Doral in Miami.”

"This amounted to the Trump Foundation functioning as little more than a checkbook to serve Mr. Trump’s business and political interests," Underwood, a Democrat, said Tuesday, reiterating her claim from when the lawsuit was filed.

Trump criticized the lawsuit after its filing as being brought by “sleazy New York Democrats.”

The lawsuit also targeted the president, his sons Donald Jr. and Eric, and daughter Ivanka, personally. The suit seeks $2.8 million in restitution and a ban on Trump leading any other charitable organization for 10 years.

A Trump attorney accused Underwood on Tuesday of providing a "misleading" characterization of the liquidation stipulation the two sides signed.

“Contrary to (Underwood's) misleading statement issued earlier today, the foundation has been seeking to dissolve and distribute its remaining assets to worthwhile charitable causes since Donald J. Trump’s victory in the 2016 Presidential election," Alan Futerfas, attorney for the Trump Foundation, said in an email. "Unfortunately, the NYAG sought to prevent dissolution for almost two years, thereby depriving those most in need of nearly $1.7 million ... The NYAG’s inaccurate statement of this morning is a further attempt to politicize this matter.”

Underwood's office countered that a court-supervised liquidation was necessary given the foundation's track record.

"After our office began investigating the Trump Foundation’s illegal conduct, the Foundation attempted to dissolve without any oversight or accountability," Amy Spitalnick, a Underwood spokeswoman, said in an email. "Given the Trump Foundation’s egregious pattern of illegality — including repeatedly using charitable assets for unlawful purposes — that was unacceptable. That’s why AG Underwood’s suit demanded dissolution under court supervision, with our office’s oversight of how the charitable assets will be distributed — and that’s exactly what we achieved with the Trump Foundation’s concession today."

The foundation must file a response to the lawsuit in early January. Separately, in 30 days it must produce a list of proposed donation recipients for review.