New York Attorney General Barbara Underwood on Thursday announced a lawsuit against the charity founded by President Donald Trump and his family, arguing that there is a “pattern of persistent illegal conduct” that stretches back more than 10 years including efforts to boost his presidential prospects.

The suit alleges Trump used the Donald J. Trump Foundation to fund his legal bills and market his business efforts, including Trump-branded hotels, and to purchase personal items.

At the same time, the suit claims Trump used the foundation to illicitly provide support for his successful bid for the presidency in 2016. The suit points to the Trump Foundation’s name being used to raise money and promote his candidacy in the days leading up to the Iowa caucuses.

“As our investigation reveals, the Trump Foundation was little more than a checkbook for payments from Mr. Trump or his businesses to nonprofits, regardless of their purpose or legality,” Underwood said. “This is not how private foundations should function and my office intends to hold the Foundation and its directors accountable for its misuse of charitable assets.”

The foundation raised more than $2.8 million in order to influence the election, the suit alleges, including funds from a nationally televised fnudraiser that were used instead of Trump’s participation in a Republican presidential primary debate.

In addition to naming Trump, the suit also names his children, who are the directors of the foundation, Donald J. Trump, Jr., Ivanka Trump, and Eric Trump.

Trump lashed out at the suit in a series of tweets, inferring incorrectly that Eric Schneiderman is still the attorney general. Schneiderman resigned last month after he was accused by multiple women of physical abuse.

Underwood was appointed by the Legislature in May to fill out the remainder of Schneiderman’s term. Schneiderman’s office did sue Trump’s for-profit college, Trump University, which ultimately resulted in a settlement.

“The sleazy New York Democrats, and their now disgraced (and run out of town) A.G. Eric Schneiderman, are doing everything they can to sue me on a foundation that took in $18,800,000 and gave out to charity more money than it took in, $19,200,000,” Trump posted. “I won’t settle this case!…”

But in a follow up tweet, Trump acknowledged Schneiderman was no longer in office.

“….Schneiderman, who ran the Clinton campaign in New York, never had the guts to bring this ridiculous case, which lingered in their office for almost 2 years. Now he resigned his office in disgrace, and his disciples brought it when we would not settle.”