NEW YORK (Reuters) - Paul Manafort, U.S. President Donald Trump’s former campaign chairman, on Wednesday won the dismissal of New York state fraud charges, in a defeat for the Manhattan district attorney’s efforts to hold him accountable even if pardoned by Trump.

Justice Maxwell Wiley of the state Supreme Court in Manhattan said at a hearing that letting the district attorney, Cyrus Vance, prosecute Manafort would violate Manafort’s protection against double jeopardy, or being prosecuted twice for the same conduct.

“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,” Vance’s spokesman Danny Frost said in a statement.

Vance, a Democrat, announced the indictment of Manafort on 16 felony counts including residential mortgage fraud on March 13, less than an hour after Manafort was ordered to spend 7-1/2 years in prison on various federal charges.

Those charges stemmed from former U.S. Special Counsel Robert Mueller’s probe into Russian interference in the 2016 U.S. presidential election, and resulted in Manafort’s August 2018 conviction on tax evasion and bank fraud.

Trump, a Republican, has denied colluding with Moscow.

Manafort, 70, has been serving his sentence at a federal prison in Pennsylvania, but was hospitalized last week for what his lawyer called a cardiac incident.

FILE PHOTO: Former Trump campaign chairman Paul Manafort, exits the courtroom after his arraignment in New York Supreme Court in New York, U.S., June 27, 2019. REUTERS/Eduardo Munoz

He did not attend Wednesday’s hearing but his lawyer, Todd Blanche, said “obviously, we are very happy” with the dismissal. Manafort had pleaded not guilty.

“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 in a statement.

Vance focused his case on Manafort’s alleged efforts to obtain millions of dollars of loans, centering on mortgage applications to three banks involving properties in Manhattan; Brooklyn; the Hamptons in Long Island, New York; and California.

These loans underlay some of the federal case against Manafort in Virginia that led to his prison sentence.

In his 26-page decision, Wiley said the federal bank fraud and state residential mortgage fraud laws under which Manafort was prosecuted were both intended to combat lending abuses and avert a repeat of the 2008 financial crisis.

He said that meant Vance could not prosecute Manafort under an exception to New York’s double jeopardy prohibition where state laws target “very different kinds of harm or evil” than federal laws.

“The harm or evil the federal bank fraud and the state residential mortgage fraud and attempted residential mortgage fraud statutes were aimed at combating are the same,” Wiley wrote. “They are certainly not of a very different kind.”

Mueller’s team had accused Manafort of hiding $16 million from U.S. tax authorities that he earned as a consultant for pro-Russian politicians in Ukraine, and then lying to banks to obtain loans and enjoy a luxurious lifestyle.

Manafort could have faced up to 25 years in prison if convicted on the top state charges.

A conviction could have ensured that Manafort spent a long time in prison even if Trump pardoned him in his federal case. The U.S. president cannot pardon people for state crimes.

Manafort worked on Trump’s White House campaign for five months in 2016.