President Donald Trump’s personal foundation illegally acted as an extension of his 2016 presidential campaign, according to New York’s chief law enforcement officer.

Barbara Underwood, the state’s new attorney general, alleged a widespread campaign of misuse of charitable resources in the service of Trump’s political efforts in a complaint filed in New York’s supreme court on Thursday. Her office is now seeking $2.8 million in penalties, which Trump said on Wednesday he would refuse to pay.

The Donald J. Trump Foundation, Underwood alleges, “acted in a persistently illegal manner by repeatedly intervening in Mr. Trump's campaign for president in 2016 by, among other things, making expenditures during the first five months of 2016 that were intended to influence his election for president.”

The coordination between the foundation and the campaign was blatant and explicit, according to documentation posted on the AG’s website. In one instance, Trump campaign manager Corey Lewandowski requested that a top foundation official give out grant money in Iowa in order to improve the campaign’s prospects in that state’s Republican caucus. Lewandowski even specified the date on which he wanted the grants rolled out—three days before Iowa Republicans went to the polls, he told a senior officer at the foundation.

When the Trump Foundation held a widely promoted veterans fundraiser in Des Moines around the same time, the Trump campaign “planned, organized, financed, and directed” the event, the AG alleges. Underwood’s office noted that a number of campaign staffers—including Lewandowski, Brad Parscale, and the campaign’s communications director Hope Hicks—were involved in the process of setting up the donation website and making arrangements for speakers at the event.

“The Fundraiser, which solicited donations from members of the public, including New York residents, reaped approximately $5.6 million in tax free donations,” the suit reads. “Of that total, $2.823 million was contributed to the Foundation.”

The suit goes on to note that the Trump Foundation took the money it held on to and spent it to benefit the Trump campaign, at the specific direction of senior campaign officials. Money raised for veterans, in other words, was being used to help elect Trump.

“All of the grants issued by the Foundation from the proceeds of the Iowa Fundraiser—which did not include any funds donated by Mr. Trump personally—were selected by the Campaign,” the complaint concludes. The explicitly political activity undertaken by the foundation, the AG alleges, amounted to illegal in-kind contributions to the Trump campaign. Nonprofits such as the foundation are prohibited from donating, even in-kind, to political entities.

The complaint faults Trump personally for those and other offenses. “Mr. Trump's wrongful use of the Foundation to benefit his Campaign was willful and knowing,” it claims. The AG’s office also referred the allegations to the IRS and the Federal Election Commission for their own potential investigations.

Trump lashed out at the AG’s office on Thursday, shortly after the lawsuit was filed, and at former New York AG Eric Schneiderman, who resigned last month in the face of allegations of sexual misconduct.

The foundation issued a similar statement, touting its charitable giving without addressing allegations that the giving was designed to assist Trump’s political endeavors—and undertaken at the direction of the Trump campaign.

“This is politics at its very worst. The Foundation has donated over $19 million to worthy charitable causes—more than it even received,” the foundation said in a statement. “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.”

But the complaint is less focused on the share of the foundation’s assets that went to charity than it is with the apparently political nature of much of its work. That political activity went beyond just its coordination with the Trump presidential campaign.

In another case, the Trump Foundation gave cash to a political group, then tried to cover its tracks by filing false reports to the IRS, the complaint alleges. In 2013, it illegally donated $25,000 to a political action committee supporting then-Florida attorney general Pam Bondi’s campaign. In its annual tax filing, the foundation omitted that donation and instead listed a non-existent contribution to a similarly named non-profit in Kansas. The attorney general alleged that a campaign fundraiser for Bondi emailed Trump’s executive assistant Rhona Graff to thank Trump for his commitment. “Mr. Trump initialed a printed copy of the email to indicate his approval for payment.”

Many of the allegations contained in the filing have been previously reported—many by the Washington Post in its Pulitzer-winning coverage of the Foundation. But Underwood’s office was able to substantiate many of those stories with additional documentation. That included an instance in which Trump himself personally directed his foundation to use its funds to settle a lawsuit in which his personal club, Mar-a-Lago, had squared off against local officials over the height at which it was raising its flags.