President Donald Trump’s charitable foundation has agreed to shut down as part of the New York state attorney general’s ongoing lawsuit against the Trump Foundation.

That lawsuit, which New York Attorney General Barbara Underwood filed in June, alleges that the Trump Foundation engaged in a “shocking pattern of illegality,” with the president using his charitable organization “as little more than a checkbook to serve Mr. Trump’s business and political interests.”

Now Underwood has announced her office has reached a deal with the Trump Foundation that will dissolve the organization. The NY AG’s office will oversee the distribution of any remaining assets to AG-approved charities.

Underwood called this a “key piece of the relief sought in our lawsuit,” in a statement on Tuesday.

But it’s far from over. The New York attorney general is continuing to seek financial restitution to the tune of $2.8 million, plus additional penalties, and the office is asking the court to bar Trump from serving in New York nonprofit organizations for 10 years. The lawsuit also calls for a one-year ban for three of Trump’s children — Don Jr., Ivanka, and Eric — all of whom were Trump Foundation board members.

“This is an important victory for the rule of law, making clear that there is one set of rules for everyone,” Underwood said in her statement. “We’ll continue to move our suit forward to ensure that the Trump Foundation and its directors are held to account for their clear and repeated violations of state and federal law.”

Wait, what is this investigation about again?

The lawsuit says that Trump’s charitable organization, which he founded in 1987, engaged in “persistently illegal conduct” and that Trump basically used the foundation as a slush fund to promote his business and political campaign.

The suit includes a number of eye-popping details of alleged shady behavior. According to the lawsuit, Trump’s former campaign manager Corey Lewandowski helped direct donations to veterans from the Trump Foundation, in an apparent attempt to promote Trump’s candidacy. The foundation also made improper campaign contributions to Florida Attorney General Pam Bondi, according to the suit.

The lawsuit also claims that the foundation’s board of directors had not formally met since 1999, and that the Trump Foundation promoted Trump properties and used money intended for philanthropy to settle various lawsuits. (You can read more about the details here and here.)

The lawsuit stemmed from a nearly two-year investigation into the foundation, which began under the tenure of former NY AG Eric Schneiderman, whose office also helped lead the suit against Trump University. (Schneiderman resigned in May after multiple women alleged he physically abused them.)

Trump has previously blasted the Trump Foundation lawsuit, calling it a “ridiculous case” and claiming it is politically motivated.

Investigations by New York have always loomed as a potential pitfall for Trump — whose business empire is based in the state — and for Trump associates. Michael Cohen, Trump’s former personal attorney who was just sentenced to three years in prison, also met with Underwood’s office. New York state tax officials are also reportedly looking into the business dealings of Trump and his family.

And there might be more to come: Incoming Attorney General Letitia James has vowed to continue to pursue the lawsuits started by her predecessors, including the Trump Foundation case, and launch additional investigations into Trump’s real estate deals, the June 2016 Trump Tower meeting, and more.

Read the stipulation dissolving the Trump Foundation below, or here.