A Plainfield man sentenced to serve 25 years in prison after pleading guilty to criminal transmission of HIV will have that sentence tossed out, the Iowa Supreme Court ruled today.

Nick Rhoades, 39, became an advocate to reform the state law after he pleaded guilty to criminal transmission of HIV following a 2008 arrest. Rhoades, who is HIV positive, had protected sex with a man who did not know about Rhoades' positive status.

The man, who did not test positive for HIV, later reported Rhoades to police. Rhoades pleaded guilty and began serving the 25-year sentence before a district court judge released him and put him on a five-year probation.

In the majority opinion today, Justice David Wiggins acknowledged several points that Rhoades' defense attorneys argued made Rhoades' guilty plea unjust. Rhoades' attorneys argued that he had a low viral load - the amount of HIV in Rhoades blood - that greatly reduced the risk of transmission, even during an unprotected oral sex act that also happened.

Rhoades also used a condom during sex, taking precautions to ensure the man wasn't exposed to bodily fluids, his attorneys argued. In the ruling, Wiggins wrote that modern medical advances and treatment options for HIV-infected people should be considered in Rhoades' case.

"Today we are unable to take judicial notice that an infected individual can transmit HIV when an infected person engages in protected anal sex with another person or unprotected oral sex, regardless of the infected person's viral load," Wiggins wrote "The evidence...shows there have been great strides in the treatment and the prevention of the spread of HIV."

Rhoades' sentence cannot be upheld under the HIV transmission law in place at the time of his arrest, Wiggins wrote. The law specifically requires that a defendant "intentionally expose" a partner to the virus, he wrote.

The court's ruling will send Rhoades' case back to Black Hawk County District Court, where prosecutors could have another chance to claim Rhoades' actions leading up to his arrest violated the law, the ruling said. If prosecutors cannot show Rhoades committed a crime, a district court judge should allow his guilty plea to be withdrawn.

Though it does not completely resolve Rhoades' case, his attorneys with Lambda Legal - a legal organization that advocates for gay and lesbian rights - celebrated the ruling.

"We applaud the court for applying the law in light of current medical understanding of how HIV is and is not transmitted," said Christopher Clark, an attorney with Lambda Legal who argued the case in front of the court. "An individual who takes precautions to prevent transmission should not be considered a criminal for choosing to be sexually active, and we are very pleased that the court agrees."

Last month, Iowa Gov. Terry Branstad signed into law updated HIV transmission legislation that advocates pushed to the legislature. The new law takes into account whether a person intended to expose a sexual partner to the virus.

Due to his case, Rhoades' became a public face of the fight to update the law and his story was featured on national media outlets, including CNN and BuzzFeed.