President Trump lashed out Wednesday at New York Democrats -- specifically, “sleazebag” former Attorney General Eric Schneiderman -- after he agreed to dissolve his charitable foundation amid a lawsuit alleging illegal conduct.

The foundation was facing numerous accusations about misusing money. But Trump complained Wednesday that the same prosecutors never scrutinized the Clinton Foundation, claiming a "double standard."

“The Trump Foundation has done great work and given away lots of money, both mine and others, to great charities over the years –with me taking NO fees, rent, salaries, etc. Now, as usual, I am getting slammed by Cuomo and the Dems in a long running civil lawsuit started by sleazebag AG Eric Schneiderman, who has since resigned over horrific abuse, when I wanted to close the Foundation so as not to be in conflict with politics,” Trump tweeted.

“Shady Eric was head of New Yorkers for Clinton, and refused to even look at the corrupt Clinton Foundation,” Trump continued. “In any event, it goes on and on & the new AG, who is now being replaced by yet another AG (who openly campaigned on a GET TRUMP agenda), does little else but rant, rave & politic against me.”

He added: “Will never be treated fairly by these people – a total double standard of ‘justice.’”

Trump’s tweets follow an announcement Tuesday by New York’s Acting Attorney General Barbara Underwood, revealing the Trump Foundation’s agreement to dissolve “under judicial supervision” amid a lawsuit brought against the foundation alleging illegal conduct and “unlawful political coordination” to benefit Trump’s personal and business interests.

Underwood brought the suit against the foundation in June, following a months-long investigation led by disgraced former New York Attorney General Eric Schneiderman, who was forced to resign earlier this year after the publication of a damning report by The New Yorker detailing four women’s claims that he hit them, threatened them, and demeaned them.

TRUMP FOUNDATION AGREES TO DISSOLVE AFTER LAWSUIT ALLEGED 'ILLEGAL CONDUCT'

The suit claimed that Trump used the foundation’s charitable assets to pay off his legal obligations, promote Trump brand hotels and business, and to purchase personal items. The suit also claims that the foundation “illegally provided extensive support to his 2016 presidential campaign by using the Trump Foundation’s name and funds it raised from the public to promote his campaign for presidency.”

The suit sought to ban Trump from future service as a director of a New York nonprofit for 10 years, and ban his sons Eric and Donald Jr., and daughter Ivanka from service for one year.

On Tuesday, Underwood announced that following the court’s decision in favor of her office, the foundation “signed a stipulation” agreeing to dissolve, distributing the remaining charitable assets of the foundation “to reputable organizations approved” by her office.

“Our petition detailed a shocking pattern of illegality involving the Trump Foundation – including unlawful coordination with the Trump presidential campaign, repeated and willful self-dealing, and much more,” Underwood said in a statement Tuesday. “This amounted to the Trump Foundation functioning as little more than a checkbook to serve Mr. Trump’s business and political interests.”

The president’s Wednesday tweets echo the statement of Trump Foundation attorney Alan Futerfas. Futerfas said the foundation had been looking to close since Trump was elected to office.

“Contrary to the NYAG’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," Futerfas said in a statement to Fox News. "Unfortunately, the NYAG sought to prevent dissolution for almost two years, thereby depriving those most in need of nearly $1.7 million. Over the past decade, the Foundation is proud to have distributed approximately $19 million, including $8.25 million of the President’s personal money, to over 700 different charitable organizations with virtually zero expenses. The NYAG’s inaccurate statement of this morning is a further attempt to politicize this matter.”

Letitia James, the newly elected New York attorney general who will replace Underwood next month, reportedly said she will continue investigation Trump and his organizations, including probing real estate deals and other investigations into “anyone” in his circle who could have violated the law.

"We will use every area of the law to investigate President Trump and his business transactions and that of his family as well," James told NBC News earlier this month.

Fox News' Kristin Brown contributed to this report.