NEW YORK — Lawyers for President Donald Trump asked a judge to dismiss a lawsuit brought against his charitable foundation by New York’s attorney general, arguing that it was politically motivated.

In the motion Thursday, Trump attorney Alan S. Futerfas argued that former New York Attorney General Eric Schneiderman “made it his stated mission to ‘lead the resistance’ and attack Mr. Trump whenever possible” and “used his public antipathy for Mr. Trump to solicit donations for his own re-election campaign and advance his career interests and aspirations.”

Trump very publicly announced his intention to dissolve the foundation and donate all of its remaining funds to charity, but the AG “actively stonewalled dissolution,” Futerfas wrote.

“At the same time, the NYAG turned a blind eye to serious and significant allegations of misconduct involving the Clinton Foundation, including claims that it, and its subsidiaries, violated New York law by failing to disclose $225 million in donations from foreign governments,” Futerfas wrote.

Schneiderman began investigating the Trump Foundation in 2016 following Washington Post reports that its spending personally benefited the presidential candidate. Schneiderman ordered the foundation to stop fundraising in New York.

Schneiderman resigned in May after allegations that he physically abused women he had dated; he denied the claims.

His successor, Democratic Attorney General Barbara Underwood, filed the lawsuit in June, claiming 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.” The suit seeks $2.8 million in restitution and the foundation’s disbandment.

The filing said Underwood continued the “inflammatory rhetoric, stating publicly that she considers her battles with the President ‘the most important work (she) has ever done’ and has vowed that such ‘work will continue.'”

Trump’s lawyers also argued that several impermissible donations by the foundation were due to clerical errors and were all corrected when brought to the attention of foundation officials.

In a statement Thursday, the attorney general’s office said it won’t back down from “holding Trump and his associates accountable for their flagrant violations of New York law.”

“As our lawsuit detailed, the Trump Foundation functioned as a personal piggy bank to serve Trump’s business and political interests,” the statement said.