(Bloomberg) -- A federal judge in Texas temporarily blocked parts of a new state law that would ban social-media companies from suspending users over political posts, handing a crucial early victory to trade groups representing Twitter Inc. and Meta Platforms Inc.’s Facebook.

U.S. District Judge Robert Pitman in Austin on Wednesday granted a request for a preliminary injunction, prohibiting enforcement of the law that was set to take effect Dec. 2. The ruling blocks the law while the litigation challenging it proceeds.

The trade groups claim the law would force Twitter, Facebook and Alphabet Inc.’s Google to host extremist content in violation of their user policies, while Texas Governor Greg Abbott and other Republicans argue the ban is needed to protect conservative viewpoints from being silenced.

The judge said an injunction is warranted because the trade groups are likely to succeed on their claim that social media platforms have a First Amendment right to moderate content on their platforms. Pitman rejected the state’s argument that social media platforms don’t get such protections because they’re not newspapers and that artificial intelligence is sometimes used to make moderating decisions.

“While this court acknowledges that a social media platform’s editorial discretion does not fit neatly with our 20th Century vision of a newspaper editor hand-selecting an article to publish, focusing on whether a human or AI makes those decisions is a distraction,” the judge wrote. “It is indeed new, and exciting -- or frightening,  depending on who you ask -- that algorithms do some of the work that a newspaper publisher previously did, but the core question is still whether a private company exercises editorial discretion over the dissemination of content, not the exact process used.”

The judge also denied Texas’s request to dismiss the lawsuit.

Texas Attorney General Ken Paxton didn’t immediately return a message seeking comment.

The groups that filed the suit, NetChoice and the Computer & Communications Industry Association, argued in court filings that allowing the law to take effect would result in their members becoming overwhelmed by “objectionable content” and falling out of favor with users.

Abbott criticized social-media companies for banning former President Donald Trump from their platforms after a mob of his supporters raided the Capitol on Jan. 6. A similar law in Florida targeting social-media companies was put on hold earlier by a judge in a suit brought by the same trade groups.

The case is Netchoice LLC v. Paxton, 1:21-cv-00840, U.S. District Court for the Southern District of Texas (Austin).

(Updates with judge’s ruling in fourth paragraph)

©2021 Bloomberg L.P.