Rejecting the immunity defense put forth by President Donald Trump's lawyers, a New York state judge on Friday ruled that a lawsuit accusing Trump and members of his family of using their "charitable" foundation as nothing more than a personal "piggy bank" can proceed.

Filed in June by New York Attorney General Barbara Underwood, the suit alleges that Trump engaged in "persistently illegal conduct" by using the Trump Foundation as a vehicle to advance his political and business aims. The lawsuit seeks to dissolve the Trump Foundation entirely.

"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," Underwood wrote in a tweet on Friday.

#BREAKING: The New York State Supreme Court just denied the motion to dismiss our lawsuit against the Trump Foundation and its directors: @realDonaldTrump, Donald J. Trump Jr., Ivanka Trump, and Eric Trump. https://t.co/rYj2I76d22 pic.twitter.com/8wJvy17Gsx — NY AG Underwood (@NewYorkStateAG) November 23, 2018 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. — NY AG Underwood (@NewYorkStateAG) November 23, 2018

New York's lawsuit is the product of a two-year investigation into the Trump Foundation, which allegedly uncovered widespread and "knowing" violations of campaign finance laws and other regulations.

Though Trump's lawyers argued that a "sitting president may not be sued," but New York state Supreme Court Justice Saliann Scarpulla ruled on Friday that the president's legal team "failed to cite a single case" supporting its defense.