Under a deal awaiting a judge's signature, the Trump Foundation would cease to exist.

ALBANY – President Donald Trump's charity will shut down and its remaining assets distributed to other nonprofit organizations as part of an agreement filed Tuesday by New York Attorney General Barbara Underwood.

The stipulation between the Donald J. Trump Foundation and Underwood's office calls for the charity to dissolve under judicial supervision, wiping out its certificate of incorporation and ending its existence.

It comes after Underwood, a Democrat, filed a lawsuit against Trump, a Republican, in June, accusing the charity of a wide array of law-breaking over the past decade and Trump of illegally using it to boost his presidential campaign in 2016.

Once signed by a judge, the Trump Foundation and Underwood's office would have 30 days to submit a plan to disperse the charity's assets to other nonprofits.

The foundation had assets totaling $1.8 million at the end of 2017, according to its tax forms.

"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," Underwood said in a statement.

An attorney for the Trump Foundation called Underwood's statement "misleading" and "inaccurate," noting the Foundation first began winding down its operations in 2016 -- when then-Attorney General Eric Schneiderman began investigating it.

“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," the attorney, Alan Futerfas, said in a statement.

Ongoing court battle

Underwood's office has been jostling in court with the Trump Foundation since originally filing the lawsuit, which seeks to force Trump and his family to pay $2.8 million in restitution.

More: NY Attorney General sues Donald Trump, Trump Foundation, accusing them of illegal conduct over 10 years

The suit took particular issue with the Trump Foundation's January 2016 fundraiser for veterans organizations, which came in the days before the Iowa caucuses.

According to Underwood's office, the event was largely directed by Trump's campaign staff, which directed where the funds went. The oversized checks presented to recipients had Trump's "Make America Great Again" campaign slogan emblazoned on the bottom.

The foundation is registered in New York, where state law prohibits charities from participating in political events.

Schneiderman began investigating the foundation in 2016 amid questions raised by the Washington Post and other media outlets about whether the charity was engaged in unethical or illegal practices.

The investigation helped prevent the foundation from shutting down while the probe was ongoing.

Lawsuit to continue

The lawsuit also took issue with the Trump Foundation's structure, noting its board of directors was essentially non-existent, having not met since 1999.

It also accused the foundation of "improper self-dealing" by settling a pair of lawsuits against Trump-owned businesses with funds from the charity.

More: 5 takeaways from New York's Trump Foundation lawsuit

In one instance, a dispute over a hole-in-one contest at the Trump National Golf Club in Briarcliff Manor, Westchester County, was settled in part with a $158,000 payment from the Trump Foundation to a foundation run by Martin Greenberg, the golfer at the center of the dispute.

Other examples cited in the lawsuit include a $5,000 advertisement purchased by the Trump Foundation in the program for the DC Preservation League's 2014 gala. The ad, which Trump reimbursed the foundation for after the investigation began, promoted a Trump hotel.

Underwood vowed to continue with the lawsuit despite the charity dissolving.

"We’ll continue to move our suit forward to ensure that the Trump Foundation and its directors are held to account for their clear and repeated violations of state and federal law," she said in a statement.

Trump himself is a defendant in the case, as are the Trump Foundation and three of his children: Ivanka, Eric and Donald Trump Jr.

The lawsuit also seeks to ban Trump and his three eldest children from serving on the boards of other New York charities.

When the suit was filed in June, Trump suggested it was politically motivated, pointing to Schneiderman, a frequent Trump foe who stepped down in May after he was accused of physically abusing women.

"I won't settle this case," Trump tweeted at the time.

In his statement Tuesday, Futerfas, the attorney representing the Trump Foundation, said the charity remains proud of its efforts, claiming it distributed approximately $19 million to 700 charitable organizations.