A New York judge Wednesday tossed the real estate fraud case brought by Manhattan District Attorney Cyrus Vance against Paul Manafort, ruling that the charges violated the state’s double jeopardy laws.

Vance's office accused Manafort, President Donald Trump's former campaign chairman, of falsifying business records to obtain millions of dollars in residential mortgage loans in a scam that began in December 2015 and continued until three days before Trump's 2017 inauguration.

But Justice Maxwell Wiley of the New York County Supreme Court dismissed the case because Manafort, 70, had been indicted earlier this year for similar types of crimes uncovered by former special counsel Robert Mueller. The longtime GOP operative is serving a seven-and-a-half year prison sentence after a jury convicted him in one federal case and he pleaded guilty in another.

"The court concludes that, given the rather unique set of facts pertaining to defendant’s previous prosecution in federal court, and given New York’s law on this subject, defendant’s motion to dismiss the indictment as barred by state double jeopardy law must be granted," Wiley wrote in a 26-page ruling filed Wednesday morning.

The state charges were seen by some legal experts as a way to hold Manafort accountable for his crimes in the event Trump decided to pardon him on the federal charges. Vance's office vowed to appeal.

"We will appeal today's decision and will continue working to ensure that Mr. Manafort is held accountable for the criminal conduct against the people of New York that is alleged in the indictment," Danny Frost, a spokesperson for the Manhattan district attorney's office, said.

The ruling came a day after Manafort's lawyer revealed that his client, who's locked up at a federal prison in Pennsylvania, has been hospitalized since Thursday with an unspecified medical condition.

Manafort's attorney, Todd Blanche, cheered the judge's ruling.

"This indictment should never have been brought, and today's decision is a stark reminder that the law and justice should always prevail over politically motivated actions," Blanche said.

CORRECTION (Dec. 18, 2019, 1:25 p.m.) : An earlier version of this article misspelled the last name of a New York judge. He is Justice Maxwell Wiley, not Riley.