This photo provided by the Clarke County Jail in Osceola, Iowa, shows Clarke County Attorney Michelle Rivera. An Iowa judge cited the courthouse arrest Oct. 18, 2018, of Rivera, a prosecutor, for being drunk in an Osceola courtroom in dismissing charges against a man accused of sexually abusing a 13-year-old boy. Judge Marti Mertz issued the ruling Monday, Dec. 17, 2018, while chastising Rivera. (Clarke County Jail via AP)
AP
This photo provided by the Clarke County Jail in Osceola, Iowa, shows Clarke County Attorney Michelle Rivera. An Iowa judge cited the courthouse arrest Oct. 18, 2018, of Rivera, a prosecutor, for being drunk in an Osceola courtroom in dismissing charges against a man accused of sexually abusing a 13-year-old boy. Judge Marti Mertz issued the ruling Monday, Dec. 17, 2018, while chastising Rivera. (Clarke County Jail via AP)
Now playing
00:40
Prosecutor arrested for coming to court drunk
TOKYO, JAPAN - JULY 23: General view inside the stadium as fireworks go off while Naomi Osaka of Team Japan lights the Olympic cauldron with the Olympic torch during the Opening Ceremony of the Tokyo 2020 Olympic Games at Olympic Stadium on July 23, 2021 in Tokyo, Japan. (Photo by Laurence Griffiths/Getty Images)
Laurence Griffiths/Getty Images
TOKYO, JAPAN - JULY 23: General view inside the stadium as fireworks go off while Naomi Osaka of Team Japan lights the Olympic cauldron with the Olympic torch during the Opening Ceremony of the Tokyo 2020 Olympic Games at Olympic Stadium on July 23, 2021 in Tokyo, Japan. (Photo by Laurence Griffiths/Getty Images)
Now playing
02:22
Tokyo 2020 Games officially underway after yearlong delay
Now playing
07:51
Smerconish: Don't punish the vaccinated
CNN Weather
Now playing
01:43
Flash flooding continues to threaten the Southwest this weekend
Gov. Kay Ivey gives the State of the State Address to a joint session of the Alabama Legislature on Tuesday, Feb. 4, 2020, in the old house chamber of the Alabama State Capitol in Montgomery, Ala. (AP Photo/Vasha Hunt)
Vasha Hunt/AP
Gov. Kay Ivey gives the State of the State Address to a joint session of the Alabama Legislature on Tuesday, Feb. 4, 2020, in the old house chamber of the Alabama State Capitol in Montgomery, Ala. (AP Photo/Vasha Hunt)
Now playing
01:00
Alabama governor: It's time to start blaming unvaccinated folks
Pool
Now playing
02:06
WaPo: This is what Trump's PAC is spending its money on
TMFPD
Now playing
00:48
Crew battling Tamarack Fire makes narrow escape out of fire and flames
Getty Images
Now playing
01:55
'Almost giddy': Author describes Trump during Capitol riot
CNN/KTRK
Now playing
03:07
Keilar rolls the tape on Ted Cruz's 'ironic' message about political stunts
CNN
Now playing
03:06
Nurse says patients in ICU with Covid-19 begging for vaccine
AFPTV
Now playing
01:03
See protesters outside Olympics opening ceremony
Now playing
04:56
Brianna Keilar pushes back on city leader: That's anti-science
US Speaker of the House, Nancy Pelosi, Democrat of California, speaks at her weekly press briefing on Capitol Hill in Washington, DC, on July 22, 2021. (Photo by Brendan SMIALOWSKI / AFP) (Photo by BRENDAN SMIALOWSKI/AFP via Getty Images)
BRENDAN SMIALOWSKI/AFP/AFP via Getty Images
US Speaker of the House, Nancy Pelosi, Democrat of California, speaks at her weekly press briefing on Capitol Hill in Washington, DC, on July 22, 2021. (Photo by Brendan SMIALOWSKI / AFP) (Photo by BRENDAN SMIALOWSKI/AFP via Getty Images)
Now playing
01:21
Pelosi explains why she rejected GOP lawmakers from January 6 committee
Getty Images
Now playing
00:54
Nick Jonas injured during NBC Olympics special
Valerie Gordon
Now playing
00:59
Watch cattle flee as California wildfire rages
Fox News
Now playing
02:31
Tucker Carlson insults Capitol police officer
A boy receives a dose of the Pfizer/BioNTech Covid-19 vaccine at the Clalit Healthcare Services in the Israeli city of Holon near Tel Aviv on June 21, 2021, as Israel begins coronavirus vaccination campaign for 12 to 15-year-olds. - Israel is now urging more 12- to 15-year-olds to be vaccinated, citing new outbreaks attributed to the more infectious Delta variant. (Photo by JACK GUEZ / AFP) (Photo by JACK GUEZ/AFP via Getty Images)
JACK GUEZ/AFP/AFP via Getty Images
A boy receives a dose of the Pfizer/BioNTech Covid-19 vaccine at the Clalit Healthcare Services in the Israeli city of Holon near Tel Aviv on June 21, 2021, as Israel begins coronavirus vaccination campaign for 12 to 15-year-olds. - Israel is now urging more 12- to 15-year-olds to be vaccinated, citing new outbreaks attributed to the more infectious Delta variant. (Photo by JACK GUEZ / AFP) (Photo by JACK GUEZ/AFP via Getty Images)
Now playing
02:10
CDC warns of 'pandemic of the unvaccinated'
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.

According to a criminal complaint, she was arrested the afternoon of October 18 at the courthouse. Deputy George Barber III said he noticed that “Rivera was slurring her words and stumbling on her feet,” and that he could “smell a strong odor of alcohol.”

He asked her to step out of the courtroom and to take a breath test. She refused the latter, and Barber arrested her.

Rivera, 42, pleaded guilty to a public intoxication charge and paid a $65 fine, according to court records.

CNN reached out Thursday to Rivera and an attorney who appears to represent her but requests for comment have not been answered.

Rivera was also arrested last week on suspicion of operating a vehicle while under the influence and of child endangerment. Her first appearance in court was scheduled for Thursday.

In her November re-election bid, she was defeated when she received only 29% of the vote. She prosecutes every case in the county, which has about 10,000 residents; she does not have an assistant.

Rivera’s first arrest came just before a hearing for the defendant in the sexual abuse case. The 23-year-old man had admitted to engaging in a sex act with a minor in August 2017, police records say. He was arrested the next month.