The Texas law dubbed the "Drag Ban" that restricted "sexually oriented performances" in the presence of a child or on public property was ruled unconstitutional on Tuesday by a federal judge, who issued a permanent injunction that bars state officials from enforcing it.

Senate Bill 12 was signed by Republican Gov. Greg Abbott in June and was set to go into effect Sep. 1, but it was blocked after being challenged by the American Civil Liberties Union (ACLU), which filed a lawsuit against the law last month.

In his ruling, U.S. District Judge David Hittner for the Southern District of Texas said the law was "an unconstitutional restriction on speech" and that it "violates the First Amendment as incorporated to Texas by the Fourteenth Amendment of the United States Constitution."

TRUMP CAMPAIGN WALKS BACK CLAIM FORMER PRESIDENT PURCHASED GLOCK AMID QUESTIONS ABOUT LEGALITY

Texas Capitol building dome with the Texas flag waving in front.

The Texas State Capitol in Austin. (Tamir Kalifa / Getty Images / File)

The ruling further ordered Republican Texas Attorney General Ken Paxton and other state officials to not enforce the law.

According to one of the definitions in the law, a "sexually oriented performance" means a visual performance that features "a male performer exhibiting as a female, or a female performer exhibiting as a male, who uses clothing, makeup, or other similar physical markers and who sings, lip syncs, dances, or otherwise performs before an audience" and "appeals to the prurient interest in sex."

Critics have referred to the law as a "drag ban," though its author and supporters say it was proposed and signed into law to protect children.

WATCH: REPORTERS PILE ON FRUSTRATED KARINE JEAN-PIERRE OVER BIDEN PLAN TO JOIN UAW PICKET

Ken Paxton in front of Supreme Court

Texas Attorney General Ken Paxton (Drew Angerer / Getty Images / File)

The ACLU filed its lawsuit in the U.S. District Court in the Southern District of Texas in Houston and said the law "unconstitutionally singles out drag performances as a disfavored form of expression." It also asserted that several terms are not defined or are written in a way that targets protected expression.

"Drag" was described in the lawsuit as an "art form" that is "inherently expressive" and has no set standard. "As with any art form, there is nothing inherently sexual or obscene about drag," the lawsuit reads. "Drag can be performed for any age level and in any venue, since drag artists tailor their performances to their audience."

CLICK HERE TO GET THE FOX NEWS APP

Fox News Digital has reached out to Paxton's office for comment.

Fox News' Greg Wehner contributed to this report.