A judge dropped charges against a man accused of sexually assaulting a 13-year old boy after the prosecutor in the case was arrested for showing up to court drunk.

Judge Marti Mertz of Clarke County, Iowa, issued the ruling Monday while scolding Clarke County prosecutor Michelle Rivera, according to The Associated Press. Rivera was arrested at the courthouse in October for appearing at a hearing drunk.

Mertz said she was forced to drop the sexual assault charge because of Rivera’s unavailability, saying it “was the finale following unexplained periods of inactivity and lack of responsiveness.”

ADVERTISEMENT

In a criminal complaint, a sheriff’s deputy said he noticed Rivera "slurring her words and stumbling on her feet" in the courtroom, and he arrested her after she refused to take a breathalyzer test. She was charged and later pleaded guilty to public intoxication, resulting in a fine of $65.

The man was arrested in August 2017 and was initially charged with sex assault and telephone dissemination of obscene material to a minor.

“If the defendant is not put on trial [and] is not tried within a year, you have the potential to have that case dismissed, and that’s what happened here,” the defendant’s attorney Marshall Orsini told the AP.

The county could pursue other charges against the man but cannot try him again on the same ones.

Rivera lost her reelection bid in November to serve as Clarke County attorney. She was again arrested last week on charges of operating a vehicle while intoxicated and a child endangerment charge for having a child in the car with her, according to the Des Moines Register.

Rivera did not immediately respond to a request for comment.