CHARLESTON, W.Va. — A judge in West Virginia has dismissed a lawsuit filed on behalf of a transgender male student who said an assistant principal harassed him when he tried to use the boys' bathroom, the American Civil Liberties Union's West Virginia chapter said Wednesday.

Harrison County Circuit Judge Chris McCarthy granted a motion this week by the Harrison County Board of Education to dismiss the lawsuit.

"We are disappointed in the court's decision," ACLU of West Virginia legal director Loree Stark said in a statement. "However, this was largely a procedural ruling and did not address the underlying allegations in the case. We are currently exploring our options going forward, but we are not done fighting for justice in this matter."

McCarthy ruled the school board was immune from liability for the actions of Liberty High School Assistant Principal Lee Livengood, The Exponent Telegram reported.

"We are glad we are able to get this case dismissed, put this behind us and move on," said Harrison County Schools Superintendent Mark Manchin told the newspaper.

The lawsuit filed on behalf of student Michael Critchfield accused the board of failing to create a safe school environment. Stark and Wheeling attorney Teresa Toriseva represented the student.

The ACLU said Livengood followed Critchfield into the boys' bathroom in November 2018 at the school and said, "You freak me out." Critchfield said he also was ordered to prove his gender by using a urinal. He was 15 at the time.

The lawsuit sought unspecified damages and to prohibit Livengood from having contact with Critchfield and his family.

According to Critchfield, the school band was preparing to take an after-school bus trip to Morgantown to watch a performance at West Virginia University. Critchfield said he went to the bathroom and checked to see if anyone was standing at a urinal before he went into a stall.

Livengood then opened the bathroom door and asked if any students were in the stall. Critchfield said he replied and when he left the stall, Livengood was standing in the bathroom doorway and blocked Critchfield from leaving.

Critchfield recalled Livengood repeatedly yelling, "Why are you in here? You shouldn't be in here."

Critchfield said he replied that it was his legal right to use that bathroom. He said Livengood used improper pronouns when referring to Critchfield and challenged him to use a urinal to prove that he was a boy.

Livengood's attorney, Alex Shook, had argued that his client was unaware of Critchfield's gender identity and was not told of an arrangement Critchfield had with the principal to use the boys' restrooms.

Livengood was suspended with pay but allowed to return after a holiday break. Last March the school board voted not to renew his contract at the end of a three-year probationary period, then reversed itself a month later and reinstated him.