[What you need to know to start the day: Get New York Today in your inbox.]

The Donald J. Trump Foundation, once billed as the charitable arm of the president’s financial empire, agreed to dissolve on Tuesday and give away all its remaining assets under court supervision as part of an ongoing investigation and lawsuit by the New York attorney general.

The foundation was accused by the attorney general, Barbara Underwood, of “functioning as little more than a checkbook to serve Mr. Trump’s business and political interests,” and of engaging in “a shocking pattern of illegality” that included unlawfully coordinating with Mr. Trump’s 2016 presidential campaign.

In addition to shuttering the charity, her office has pursued a lawsuit that could bar President Trump and his three oldest children from the boards of other New York charities, as well as force the payment of millions in restitution and penalties.

“This is an important victory for the rule of law, making clear that there is one set of rules for everyone,” Ms. Underwood said in announcing the agreement.