Carrie Witt, 44, was charged in March last year with having sex with the students aged between 16 and 19 years old while teaching at Decatur High School

An Alabama high school teacher accused of having sex with two students has had her charges thrown out after a judge ruled it as unconstitutional.

Carrie Witt, 44, was charged in March last year with having sex with the students aged between 16 and 19 years old while teaching at Decatur High School.

The judge dismissed both charges without prejudice on constitutional grounds on Thursday, WHNT reports.

Morgan County Circuit Judge Glenn Thompson said the court found the statute 'unconstitutional' and that there was no proof Witt used her position of authority to force the two students to have sex.

The judge noted that state law allows students to legally have sex at age 16, as long as someone doesn't use their position of authority to obtain that consent.

Judge Thompson said that position of power 'clearly does not exist between every school employee and every student regardless of where that student is enrolled.'

Prior to the sex allegations, Witt taught history, psychology and social studies, as well as coaching the varsity girls' golf team and and junior varsity cheerleading at Decatur High

A judge dismissed both charges against the 44-year-old without prejudice on constitutional grounds on Thursday

'It is this court's finding that the law grants these students the capacity to consent until and unless there is some showing that authority was used to obtain illegitimate or coerced consent,' Thompson wrote in his ruling.

'If no such position of authority is alleged, the defendant must be permitted to show consent as a defense.'

Prior to the sex allegations, Witt taught history, psychology and social studies, as well as coaching the varsity girls' golf team and and junior varsity cheerleading.

She was put on administrative leave with pay by Decatur High while the school investigated the situation.

Officials started investigating when police received information that a teacher was having a sexual relationship with at least one student.

While interviewing people, investigators discovered a second victim.

Though the age of consent is 16 in Alabama, a law was passed in 2010 that made it a felony for a school employee to have sex with a student under 19 years old.