A teacher who admitted sexually abusing a student and plying him with vodka has been released from prison after 195 days.

Sarah Lewis pleaded guilty to forcible sexual abuse of a teenage boy at her home in Payson, Utah, and telling the 17-year-old he had to keep their relationship secret.

But she was released before being sentenced after her lawyer discovered her crime fit the profile of a lesser offence, and brought it up with the courts, according to local media.

The Daily Herald reported in July that the lawyer, Thomas Means, pushed for the change after learning of an alteration to the law that made unlawful sexual conduct with 16- and 17-year-olds a third-degree felony, rather than the second-degree offence of forcible sexual abuse.

And KUTV said on Wednesday that Lewis, who was initially charged with rape, had been released from prison after she was charged with the lesser offence.