A California judge has rejected San Francisco’s argument that nondiscrimination laws don’t apply to its government agencies.

On Tuesday, Judge Harold Kahn overruled San Francisco’s attempt to dismiss a lawsuit brought the State of California for discriminating against a trans woman.

The city had argued that its Department of Police Accountability, the agency accused of denying Tanesh Nutall access to a women’s restroom was above the state’s Unruh Civil Rights Act. The act bars discrimination in public accommodations based on sex, race, color, religion, ancestry, national origin, disability, medical condition, genetic information, marital status, or sexual orientation.

San Francisco tried to make the case that it was not a business entity, and therefore was not allowed to operate free of antidiscrimination law that applies to business and state-funded programs.

“It’s pretty stunning,” said Transgender Law Center (TLC) staff attorney Shawn Meerkamper who is representing Nutall. “We think it’s offensive. It definitely runs counter to the image that San Francisco likes to portray.”

In Feb. 2016, Nutall attended a training at the Department of Police Accountability in San Francisco. While there, a female employee refused to let her into a keycode-locked bathroom and called her a “fucking man” and a “fucking freak,” according to a lawsuit.

TLC says the San Francisco Human Rights Commission Refused to Investigate a complaint Nutall filed in the wake of the incident, claiming it couldn’t investigate a city agency. That prompted the state of California to file the lawsuit on her behalf.

John Coté, communications director for the Office of San Francisco City Attorney Dennis J. Herrera told INTO in an email that the city refuted the allegations.

“It is our understanding that the factual allegations in this lawsuit are not entirely accurate and that a city employee did not violate Ms. Nutall’s protected rights,” he said.”We look forward to the full picture coming out in court.”

He added that the city respects the rights of all individuals.

“This city has been a leader on equality for decades,”Coté said.”We also have a legal responsibility to San Francisco taxpayers.”

Coté did not respond to a previous inquiry over whether San Francisco believed nondiscrimination laws did not apply to government agencies.

In his filing, Judge Kahn found that the Department of Police Accountability was acting as a business and therefore required to comply with the Unruh Act.

Nutall has also filed a federal lawsuit against San Francisco. The city is also seeking to dismiss that case.