LOUISVILLE, Ky., (WDRB) -- A judge ruled Tuesday that the behavior of the Jefferson Commonwealth's Attorney's office in a felony case she had dismissed for prosecutorial misconduct was "lamentable," but she gave them the opportunity to bring the case back to court.

In a sometimes blistering ruling Tuesday, Jefferson Circuit Court Judge Audra Eckerle accused a prosecutor of intentionally withholding evidence and "secretly" trying to hide his tracks.

But Eckerle ruled that "the cover-up was worse than the crime" and the defendant now had all of the evidence and could still get a fair trial.

Also this week, the prosecutor involved, Jamhal Woolridge, resigned, though it is unclear if the resignation had anything to do with the allegations of wrongdoing in May.

In a resignation letter on Monday, Woolridge said he was resigning immediately “due to the unforeseen circumstances I have experienced within the last three months.”

Commonwealth’s Attorney Tom Wine said Woolridge “did not elaborate on his resignation. I wished him well.”

Woolridge could not be immediately reached for comment.

Wine also said the office was “still litigating the dismissal” of the case Woolridge was involved with “as we do not believe there was prosecutorial misconduct.”

In May, Eckerle ruled Woolridge “deliberately” and “improperly” withheld key evidence from a defense attorney and dismissed an assault case against  Sandoval.

The judge did not change her mind about that on Tuesday, but "despite the lamentable behavior exhibited here," Eckerle ruled the case could be dismissed "without prejudice," meaning prosecutors can bring it back to court again if they wish.

That ruling came, at least in part, because Sandoval's attorney, Rob Eggert, figured out that the prosecution was withholding evidence and made sure it was turned over before trial, Eckerle wrote.

"The court does not believe that the prosecuting attorney's action irrevocably tainted the evidence," Eckerle ruled.

Eggert said he respected the judge's decision but declined to comment further.

In her ruling, Eckerle maintained that the Commonwealth's Attorney's office excluded documents from evidence turned over to the defense, "secretly" shelved the subpoena saying how they had obtained the records and prejudiced Sandoval.

And Eckerle said while withholding the documents was bad enough, "the intentional dismantling of evidence and extraction of other documents that would have shown it was hiding other documents is even worse than the concealment of the medical records."

Wine had not yet seen the order and declined to comment.

In May, Eggert had asked Eckerle to rule that Woolridge had committed misconduct and dismiss the case against Sandoval, who was accused of assaulting another man in a 2013 bar fight.

Eggert claimed Woolridge removed medical records that showed the alleged victim had a drinking problem, which would have been a key part of Sandoval's self-defense argument.

But prosecutors argue that Eggert never indicated his client would be claiming self-defense and the medical records in question were from an unrelated 2011 incident, more than two years before the current case.

In her ruling this week, Eckerle ruled that the commonwealth doesn't have the authority to decide which evidence needs to be turned over, and accused the office of playing "cat and mouse" games.

While the dismissal of a case for failing to turn over evidence is rare, defense attorneys have repeatedly made allegations of prosecutorial misconduct in recent years.

Under state law, prosecutors are required to turn over any evidence that may be favorable to the defense. And the United States Supreme Court has ruled that hiding evidence favorable to the defense violates a defendant's constitutional right to due process.

Copyright 2015 WDRB Media. All rights reserved.