EVANSVILLE, Ind. — A federal judge has ordered an Indiana school district to allow a transgender student to use male bathrooms.

Judge William Lawrence signed an injunction Friday, just days before classes resume in the Evansville Vanderburgh school district.

The 17-year-old student sued after he was told to use the female restroom or bathrooms in the nurse’s office. He says his rights were violated .

School officials said the student could use the male bathroom if his birth certificate was changed to identify him as a male.

The American Civil Liberties Union of Indiana says the student was born in a state that won’t do that unless a surgery takes place. The ACLU says the teen is under a doctor’s care and getting hormone therapy.

The teen says he experiences distress when forced to use the female restroom. The judge found the claims credible.