CHICAGO — Federal education authorities, staking out their firmest position yet on an increasingly contentious issue, found Monday that an Illinois school district violated anti-discrimination laws when it did not allow a transgender student who identifies as a girl and participates on a girls’ sports team to change and shower in the girls’ locker room without restrictions.

Education officials said the decision was the first of its kind on the rights of transgender students, which are emerging as a new cultural battleground in public schools across the country. In previous cases, federal officials had been able to reach settlements giving access to transgender students in similar situations. But in this instance, the school district in Palatine, Ill., has not yet come to an agreement, prompting the federal government to threaten sanctions. The district, northwest of Chicago, has indicated a willingness to fight for its policy in court.

The Education Department gave 30 days to the officials of Township High School District 211 to reach a solution or face enforcement, which could include administrative law proceedings or a Justice Department court action. The district could lose some or all of its Title IX funding.

In a letter sent Monday, the Office for Civil Rights of the Department of Education told the Palatine district that requiring a transgender student to use private changing and showering facilities was a violation of that student’s rights under Title IX, a federal law that bans sex discrimination. The student, who identifies as female but was born male, should be given unfettered access to girls’ facilities, the letter said.