DECATUR, Ala. – An Alabama teacher accused of having sex with two of her students succeeded in having her charges thrown out on constitutional grounds, Morgan County Circuit Judge Glenn Thompson confirmed Thursday.

Carrie Witt was facing potential prison time for allegedly having sex with two students between 16 and 19 years old while she taught at Decatur High School.

Witt had the two charges dismissed without prejudice, but the state can still refile the charges if done in an appropriate amount of time.

Thompson noted in his ruling that students can consent to sex under state law once they turn 16 unless someone uses a "position of authority" to "coerce, groom, or otherwise obtain the illegitimate consent of the alleged victims."

The judge found that while there may be a gap in power between teacher and student, it "clearly does not exist between every school employee and every student regardless of where that student is enrolled."

The court held that prosecutors must prove a school employee "was actually in a position of authority over the victim/student and that the position of authority was abused to obtain consent."

The court noted that the state has an abiding interest in protecting people from being preyed on by someone in authority over them, such as teachers, wardens, clergy members and psychologists.

But, the court found, the law goes too far in denying any possibility of consent.

“The statute at hand embeds an irrebuttable presumption that any sexual encounter between an employee of any school and any student (without qualification as to class, school, or school system) is conclusively the result of misuse of authority," the judge wrote.

“The law takes away the right of the employee to assert a defense that legal consent that was freely and legitimately given – abrogating the student’s capacity to consent.”

The court also noted that the ruling was based on the allegations in the indictments in the case. The judge said there was no testimony or evidence presented at the hearing where the court heard arguments on the law's constitutionality.

The court also cited a Kansas law that he said draws a key distinction from Alabama's current law. The court said the Kansas law bars sexual relationships between students and teachers or other school officials when the student is enrolled at the school.