The New York attorney general filed a lawsuit Thursday against President Donald Trump, his charity, and his children Donald Jr., Eric, and Ivanka.

The suit alleges that the Donald J. Trump Foundation followed "a pattern of persistent illegal conduct" for more than a decade.

Trump responded to the suit on Twitter, blasting "sleazy New York Democrats, and their now disgraced (and run out of town) A.G. Eric Schneiderman."

New York Attorney General Barbara Underwood on Thursday filed a lawsuit against President Donald Trump, his charity, and his children Donald Jr., Eric, and Ivanka, alleging that the Donald J. Trump Foundation followed "a pattern of persistent illegal conduct" for more than a decade.

The lawsuit claims that the charity engaged in illegal political coordination with Trump's campaign, made multiple self-dealing transactions to benefit Trump personally and his business interests, and violated legal obligations for such nonprofits in New York.

Underwood is seeking $2.8 million in restitution plus additional penalties, as well as the dissolving of the Trump Foundation under court supervision. The suit seeks to bar Trump from running a New York nonprofit for the next decade, while instituting a one-year ban for Donald Jr., Ivanka, and Eric. Underwood also sent referral letters to the Internal Revenue Service and the Federal Election Commission identifying possible violations of federal law for the agencies to investigate.

Trump has already paid more than $330,000 in reimbursements and penalty taxes, Underwood said in the suit.

"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 in a statement. "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."

Trump responded to the lawsuit less than an hour after it was made public, blasting "sleazy New York Democrats and their now disgraced (and run out of town) A.G. Eric Schneiderman."

Eric Schneiderman started the investigation into Trump’s charity before resigning as attorney general over claims he abused women. REUTERS/Brendan McDermid Eric Schneiderman, Underwood's predecessor who started the investigation, resigned as New York attorney general last month in response to allegations he had abused multiple women.

Trump tweeted that Democrats were "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."

"I won't settle this case!" he said.

The Trump Foundation also attacked the attorney general's office, accusing it of playing "politics at its very worst." As evidence, the foundation cited the fact the lawsuit was made public on the same day as the release of the Department of Justice inspector general's report on the Hillary Clinton email investigation.

"This is unconscionable — particularly because the Foundation previously announced its intention to dissolve more than a year and a half ago," a representative of the foundation said in a statement obtained by Business Insider.

The statement went on: "The prior NYAG, who was recently forced to resign from office in disgrace, made it his stated mission to use this matter to not only advance his own political goals, but also for his own political fundraising. The acting NYAG's recent statement that battling the White House is 'the most important work [she] have ever done' shows that such political attacks will continue unabated."

The foundation pressed the New York attorney general to withdraw the lawsuit so it could dissolve and make remaining donations it proposed as a part of that plan. It said it stood to make donations to more than 50 charities once that takes place.

The New York investigation found that the charity raised more than $2.8 million to influence the election in coordination with senior leadership on Trump's campaign. It highlighted a January 2016 event Trump held to raise money for veterans causes in Iowa in lieu of participating in a Fox News primary debate. The lawsuit claims that senior campaign staff members, such as the campaign manager Corey Lewandowski, were directly involved in the foundation's payouts to nonprofits in violation of both state and federal law.

The suit alleged that the charity also entered into at least five self-dealing transactions that benefitted Trump or his businesses. Those included more than $250,000 in payments to settle claims against his Mar-a-Lago resort and the Trump National Golf Club, as well as to purchase a painting of himself that was displayed at his Miami golf club, according to the suit.

Trump was president of the foundation since its founding in 1987. He promised to shut it down in 2016 but could not while the New York investigation was ongoing.