NASHVILLE, Tenn. (AP) — A federal judge on Friday halted enforcement of a new Tennessee law requiring businesses to post special signs if they allow transgender people to use the bathroom of their choice.

The first-of-its-kind law went into effect on July 1 and would require such businesses to post signs on multiperson bathrooms that read, “This facility maintains a policy of allowing the use of restrooms by either biological sex, regardless of the designation on the restroom.”

Businesses in Nashville and Chattanooga sued over the law, claiming that being forced to post those signs would violate their First Amendment rights by compelling them to communicate language they find offensive. The state of Tennessee argued in court that the signs are merely factual.

In her Friday decision, U.S. District Judge Aleta Trauger handed a victory to the businesses that sued, granting a preliminary injunction that effectively prevents the state from enforcing the law while the case works through the courts. She noted that the U.S. Supreme Court has found that compelling individuals to “’mouth support for views they find objectionable’” violates a cardinal constitutional command unless justified by “the strongest of rationales.”

“Particularly repugnant to the First Amendment is when the government forces a private party to voice the government’s compelled message, not merely in private or in direct dealings with government itself, but ‘in public,’ as an involuntary ‘instrument for fostering public adherence to an ideological point of view,’” Trauger wrote, quoting from a Supreme Court opinion.

The law’s sponsor, Republican state Rep. Tim Rudd, has said he is concerned about sexual predators taking advantage of loose restroom policies to assault or rape other restroom users. The law also would require signage on locker rooms, shower facilities and dressing rooms, according to court filings.

The sign requirement is part of the state building codes and violations would be considered a misdemeanor offense, according to court filings. How the measure would be enforced, however, has been unclear. In June, Republican Senate Speaker Randy McNally told reporters he didn’t think it would be enforced.

In her opinion, Trauger accused the state defendants of pretending “that no one knows how the Act will be enforced, despite the fact that, of course, they know, because they will be among the ones doing the enforcing, and they are simply keeping their plans to themselves.”