(CNN) An Iowa man accused of sexual abuse of a 13-year-old has been freed after county attorney Michelle Murphy Rivera was arrested for being drunk in court.

A judge in Clarke County dismissed the case, saying the defendant didn't get a trial within a year of his arrest -- as mandated by Iowa's right to speedy trial law.

"The county attorney's unavailability at the last hearing was the finale following unexplained periods of inactivity and lack of responsiveness that prevented disposition of this case within one year," Iowa District Court Judge Martha L. Mertz wrote this week in her order to release the defendant.

A timeline included in the judge's response indicates that Rivera was slow to get back to the defense team on several occasions. Three months ago, after getting an email from the defense about the status of a plea agreement proposal, Rivera responds saying she thought she was waiting on something from the defendant and that there is no trial date scheduled. "Sorry to have dropped the ball," she writes, according to the judge's decision.

It is unclear whether attorneys for defendants from other cases Michelle Murphy Rivera has prosecuted have filed similar motions. Rivera, a Democrat, lost her re-election bid for county attorney in November after serving two four-year terms.

Read More