A federal judge on Tuesday struck down a Texas law that LGBTQ advocates feared would ban drag shows in the state and imprison performers.

The law, which Republican Gov. Greg Abbott signed in June, expanded existing state law to prevent children from exposure to sexually explicit performances. While the legislation, Senate Bill 12, does not cite drag specifically, drag performers feared that it was passed with the intention of criminalizing the art form, which has deep ties to the LGBTQ community, and would that it repress their freedom of expression.

The bill’s statement of intent leads with and repeatedly cites drag shows as a threat to children. And on the day Abbott signed the bill into law, he shared an article about it and wrote, “Texas Governor Signs Law Banning Drag Performances in Public. That’s right.”

U.S. District Judge David Hittner, who was nominated by Republican President Ronald Reagan, ruled in favor of the plaintiffs, writing that the law “impermissibly infringes on the First Amendment and chills free speech.”

“Not all people will like or condone certain performances,” Hittner wrote. “This is no different than a person’s opinion on certain comedy or genres of music, but that alone does not strip First Amendment protection.”