A New York judge on Wednesday approved the deal to dissolve the Donald J. Trump Foundation amid allegations from the New York Attorney General's Office that it engaged in a "shocking pattern of illegality."

Justice Saliann Scarpulla approved the deal, which will give the charity's $1.7 million in remaining assets to other nonprofits, The Associated Press reported.

ADVERTISEMENT

The attorney general's office and the Trump Foundation's lawyers have been asked to turn in a list of nonprofits that will receive the money within 30 days. All of the charities will receive the same amount and the attorney general's office will have the ability to veto any of them, according to the AP.

According to the agreement, the foundation will dissolve under judicial supervision.

New York Attorney General Barbara Underwood (D) on Tuesday announced her office will continue to pursue its lawsuit against the Trump Foundation, which seeks $2.8 million in restitution plus penalties, as well as an order barring President Trump Donald John TrumpBiden on Trump's refusal to commit to peaceful transfer of power: 'What country are we in?' Romney: 'Unthinkable and unacceptable' to not commit to peaceful transition of power Two Louisville police officers shot amid Breonna Taylor grand jury protests MORE and his three oldest children — Donald Trump Jr., Ivanka Trump and Eric Trump — from serving on the boards of other New York charities.

Underwood's lawsuit, filed in June, alleged that Trump used the charity for political and personal gain. Underwood is claiming that an investigation has uncovered the foundation “was little more than a checkbook for payments to not-for-profits from Mr. Trump or the Trump Organization.”

“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.

Trump in a series of tweets on Wednesday complained that he was the victim of a "total double standard" of justice after the attorney general's decision.

The president claimed that his charity "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."