Charges were dropped Wednesday against an Alabama teacher accused of having sex with a student he later married.

The woman is an essential witness in the case against Matthew Shane Wester, 38, and has refused to testify at his trial, District Attorney Pamela Casey said in documents filed in Blount County Circuit Court. The state can't prove an essential element of the case without the woman's testimony, Casey said.

The Associated Press generally doesn't name alleged sexual assault victims.

Wester was charged with being a school employee and having sexual contact with a student under 19 years old. Judge Dennis Odell ruled last week that the marriage does not protect the woman from testifying against Wester.

Wester taught math at Cleveland High School and married the 18-year-old student after he was indicted in January 2015. Prosecutors said Wester had been married but filed for divorce on Jan. 13, 2015. Prosecutors said Wester married the teen June 13 in a move they called "a sham" to prevent her from testifying against him.

Wester's attorney filed a motion Sunday to dismiss the indictment and challenged the constitutionality of the state's law against teachers having sex with students under age 19.