A suburban Chicago school district has announced that it will not allow transgender students to use locker rooms for changing and showering, defying federal civil rights officials.

Daniel E. Cates, the superintendent of Township High School District 211 in Palatine, Ill., said the district is sensitive to the challenges that transgender students face and has a support team to help them navigate at school. Transgender students are allowed to use restrooms in accordance with their gender identity, because there are private stalls, he said.

But the district will continue barring transgender students from communal locker rooms before and after gym and after-school activities, he wrote in a newsletter to families, to “ensure a respectful school environment” and “protect the privacy of all students.”

“District 211 has supported — and continues to support — transgender students and their families while always balancing the rights and concerns of all students we serve,” Cates wrote, noting that the decision means that the district is risking litigation and a loss of federal funds.

The U.S. Education Department’s Office of Civil Rights began investigating the district in response to a complaint by a transgender high school student who has been living as a girl for several years, according to the American Civil Liberties Union, which represents the student.

The student asked school officials to treat her as a female in all respects, including her participation in sports. While the student has been allowed to participate on girls’ teams, she was not allowed to change in the girls’ locker room, and was instead told to use a separate bathroom down a long hallway, according to the ACLU. That stigmatized the student, the ACLU said.

The Office of Civil Rights found that the school district’s decision to bar the student from the locker room amounted to sex discrimination, according to the ACLU.

An Education Department spokeswoman said she could not comment because the civil rights investigation is ongoing.

Often after such a finding, a district signs a settlement agreement outlining what it will do to come into compliance with the law. In the past two years, the department has twice reached settlement agreements that require school districts to allow transgender students to use restrooms in accordance with their gender identity.

District 211’s announcement suggests that it does not intend to sign such an agreement.

In a statement, the ACLU said that the district could accommodate students’ desire for privacy by allowing any student who feels uncomfortable in the locker room to use a separate room. But the district cannot, under the law, use students’ privacy as a reason to separate transgender students from their peers, the organization said.

“Transgender students now are a part of everyday American life as society has become more accepting of all kinds of differences,” John Knight of the ACLU of Illinois said in a statement. “Instead of ostracizing these students and singling them out from their fellow students, schools and communities need to embrace kids who are different and ensure that all are able to be safe, be themselves, and succeed in school.”