By Andrew Chung

(Reuters) -The U.S. Supreme Court on Tuesday blocked a Texas law that bars large social media companies from banning or censoring users based on “viewpoint,” siding with two technology industry groups that have argued that the Republican-backed measure would turn platforms into “havens of the vilest expression imaginable.”

The justices, in a 5-4 decision, granted a request by NetChoice and the Computer & Communications Industry Association, which count Facebook, Twitter and YouTube as members, to block the law while litigation continues after a lower court on May 11 let it go into effect.

The industry groups sued to try to block the law, challenging it as a violation of the free speech rights of companies, including to editorial discretion on their platforms, under the U.S. Constitution’s First Amendment.

Conservative Justices Samuel Alito, Clarence Thomas and Neil Gorsuch issued a written dissent, while liberal Justice Elena Kagan said she would have denied the industry groups’ request.

The Texas law was passed by the state’s Republican-led legislature and signed by its Republican governor. Its passage comes as U.S. conservatives and right-wing commentators complain that “Big Tech” is suppressing their views. These people cite as a prominent example Twitter’s permanent suspension of Republican former President Donald Trump from the platform shortly after the Jan. 6, 2021, attack on the U.S. Capitol by a mob of his supporters, with the company citing “the risk of further incitement of violence.”

The law, formally known as HB20, forbids social media companies with at least 50 million monthly active users from acting to “censor” users based on “viewpoint,” and allows either users or the Texas attorney general to sue to enforce it.

In signing the bill last September, Texas Governor Greg Abbott said, “There is a dangerous movement by some social media companies to silence conservative ideas and values. This is wrong and we will not allow it in Texas.”

The industry groups said the state’s law would unconstitutionally allow for government control of private speech. Restricting the platforms’ editorial control, the groups said, “would compel platforms to disseminate all sorts of objectionable viewpoints – such as Russia’s propaganda claiming that its invasion of Ukraine is justified.”

“Instead of platforms engaging in editorial discretion, platforms will become havens of the vilest expression imaginable: pro-Nazi speech, hostile foreign government propaganda, pro-terrorist-organization speech, and countless more examples,” they added.

(Reporting by Andrew Chung in New York; Editing by Will Dunham)