New York Attorney General Barbara Underwood said Tuesday that officials with the Trump Foundation have agreed to dissolve the charity under court supervision amid allegations that President Donald Trump and his children used the foundation for personal profit.

Underwood said foundation officials agreed to dissolve the embattled charity in a stipulation filed in court Tuesday.

A judge still had to sign off on the agreement, prosecutors said Tuesday.

The Trump Foundation functioned “as little more than a checkbook to serve Mr. Trump’s business and political interests,” Underwood said.

New York filed a lawsuit last spring accusing the Trump Foundation of operating like an extension of Trump's businesses and political campaign.

That suit will continue, officials said.

Lawyers for the foundation said any infractions were minor and that they have been trying to shut down the foundation voluntarily for months.

Underwood's predecessor, Eric Schneiderman, began investigating the foundation in 2016 following Washington Post reports that its spending personally benefited Trump, then a presidential candidate. Schneiderman ordered the foundation to stop fundraising in New York.

The Associated Press contributed to this report.