(Bloomberg) -- New York taxpayers must foot the bill for former Governor Andrew Cuomo’s legal defense in a civil suit filed by a onetime member of his security detail who accused him of sexual harassment, a judge ruled.

The decision Friday is a setback for New York Attorney General Letitia James, who in April declined Cuomo’s request to have the state cover his legal costs. Cuomo, who argued that the alleged harassment took place while he was a state employee, sued James in August to overcome her decision.

The decision by Justice Shlomo Hagler in New York state court in Manhattan was confirmed by representatives of Cuomo and James.

“While we disagree with the judge’s decision, we respect it,” a spokesperson for James’s office said in an emailed statement. “We are reviewing the decision and any potential next steps.”

Cuomo, a three-term Democrat who resigned in 2021 amid a harassment scandal, faced the prospect of racking up legal fees and costs in a suit in which he’s accused of touching the trooper’s neck and then running his finger down her spine before saying, “Hey, you.” He denies wrongdoing.

Cuomo’s suit against James alleged her decision to not allow the state to cover his legal fees was part of a pattern of bias against him. According to his complaint, James had called Cuomo a “serial sexual harasser” and “sick pathetic man.”

“Governor Cuomo’s legal victory over Tish’s arbitrary and unsupportable action is further evidence of what we said from Day 1: Tish James had politicized and weaponized her office for personal and political gain,” Cuomo spokesman Rich Azzopardi said in a statement.

James has repeatedly rejected Cuomo’s characterization of her work.

The suit in which Cuomo’s defense will be covered by taxpayers was filed by a woman identified only as Trooper #1. Her allegations featured heavily in a damning report about the former governor following a probe by James, including detailed accounts of 11 incidents of sexual harassment that she said violated state and federal civil law.

James did not weigh in on whether crimes had been committed and left it to local district attorneys to make that determination. Westchester County District Attorney Mimi Rocah in December 2021 determined that Cuomo’s “serious” conduct with the trooper and another woman in the county did not amount to criminal violations despite finding the witnesses “credible.”

©2023 Bloomberg L.P.