A lawsuit accusing President Donald Trump of misusing his charitable foundation for his own personal and political purposes will move forward after a Manhattan judge refused Trump's bid to throw the case out.

New York State Attorney General Barbara Underwood filed the action against the president, Donald Trump Jr., Ivanka Trump and Eric Trump earlier this year, charging that they had engaged in "extensive unlawful political coordination with the Trump presidential campaign, repeated and willful self-dealing transactions to benefit Mr. Trump's personal and business interests, and violations of basic legal obligations for nonprofit foundations."

A lawyer for the Trump Foundation fired back in August, arguing in court filings that Trump can't be sued while he's in office. He also contended the lawsuit should be thrown out because the family didn't knowingly do anything wrong, and argued the suit was only brought because of political bias.

In a 27-page ruling Friday, state Supreme Court Justice Saliann Scarpulla rejected those arguments. She noted that a judge in a different case had already ruled earlier this year that Trump is not immune to civil actions "related purely to unofficial conduct because he is President of the the United States."

She also found that contrary to the foundation's argument, the attorney general's suit had made allegations of wrongdoing that were strong enough to let the case go forward.

The suit charges that foundation funds were used to pay off Trump-owned companies' legal obligations, including a $100,000 payment to a charity that was mandated in the settlement of a lawsuit.

It also accuses Trump of illegally using his foundation to further his political ambitions, citing an Iowa fundraiser for veterans that was a thinly-disguised campaign event. The campaign also told the foundation which charities it should give to, the suit says.

Scarpulla also slapped down the foundation's argument that the action should be tossed because former New York State Attorney General Eric Schneiderman was a frequent Trump critic and foe who had engaged in repeated "personal attacks" against the president. The ruling notes that Schneiderman — who abruptly resigned earlier this year after a report he'd been abusive to women — was out of office by the time the suit was filed.

"We welcome Justice Scarpulla's decision, which allows our suit to move forward," Underwood said in a statement. "As we detailed in our petition earlier, the Trump Foundation functioned as little more than a checkbook to serve Mr. Trump's business and political interests. There are rules that govern private foundations — and we intend to enforce them, no matter who runs the foundation."

Trump Foundation lawyer Alan Futerfas said, “The decision means only that the case goes forward. As we have maintained throughout, all of the money raised by the Foundation went to charitable causes to assist those most in need. As a result, we remain confident in the ultimate outcome of these proceedings.”