North Carolina’s law limiting protections to LGBT people violates the US Civil Rights Act and cannot be enforced, the US Justice Department said on Wednesday.

Meanwhile, in Alabama, the town of Oxford buckled under public pressure and repealed a recently enacted bathroom ordinance that threatened six months in jail for anyone found using a toilet not in line with his or her biological sex.

Federal officials have recently warned states against discriminating against transgender students in school bathrooms, and a federal appeals court ruled in favor of a transgender high school student suing a school board for access to the boys’ bathroom.

But the letter to the state of North Carolina from Vanita Gupta, principal deputy assistant US attorney general, marked the federal government’s first direct intervention in the conflict.

“The Department of Justice has determined that, as a result of compliance with and implementation of NC House Bill2, both you and the state of NC are in violation of Title VII of the Civil Rights Act of 1964,” Gupta wrote to the Republican governor, Pat McGrory.

The act prohibits employers from discriminating against people based on gender identity. “Access to sex-segregated restrooms and other workplace facilities consistent with gender identity is a term, condition or privilege of employment,” Gupta wrote. “Denying such access to transgender individuals, whose gender identity is different from the gender assigned at birth, while affording it to similarly situated non-transgender employees, violates Title VII.”

The letter called HB2 is “facially discriminatory against transgender employees on the basis of sex because it treats transgender employees, whose gender identity does not match their biological sex, as defined by HB2, differently from similarly situated non-transgender employees”.

The letter also cited Title IX of the Civil Rights Act, which prohibits discrimination in education.

If a court upholds the US attorney general’s position, the state of North Carolina stands to lose $861m in federal funding for schools.

“This letter from the Department of Justice confirms what was clear from the start: HB2 is discriminatory and unconstitutional,” said Jasmine Beach-Ferrara, executive director of advocacy group Campaign for Southern Equality, which is based in Asheville, North Carolina. “We continue to call for the immediate repeal of HB2. We also call for the North Carolina general assembly to pass full legal protections for the LGBT North Carolinians.”

The North Carolina law limits legal protections to lesbian, gay, bisexual and transgender people, and requires transgender people to use public bathrooms that conform to the sex on their birth certificate.

In Alabama, the city council of Oxford voted 3-2 to recall the ordinance it passed a week ago banning anyone using a toilet not in line with his or her biological sex. The law had declared that bathroom offenders “shall be punished by fine not to exceed $500 or incarceration not to exceed six months.”

“The Oxford City Council did the right thing by recalling its discriminatory ordinance,” Chinyere Ezie, a staff attorney with the Southern Poverty Law Center, told the Guardian by email. “We are pleased the council members came to the conclusion that nobody should be criminalized simply for using the restroom.”



The Associated Press contributed to this report