NEW YORK (AP) — President Donald Trump’s charitable foundation has reached a deal to dissolve amid a legal battle with New York’s attorney general.

Attorney General Barbara Underwood and the foundation filed a joint stipulation with the court Tuesday laying out a process for shutting down the charity and distributing remaining assets to other nonprofit groups.

New York filed a lawsuit last spring accusing the foundation of operating like an extension of Trump’s businesses and political campaign. That suit will continue.

Lawyers for the foundation say any infractions were minor. They say they have been trying to shut down the foundation voluntarily for months.

A judge must still sign off on the agreement.

Underwood is a Democrat and is seeking millions of dollars in penalties. She wants Trump and his eldest children barred from running other charities.