A judge blocked a Florida law that would have prevented social media apps from taking down content from political candidates.

A federal judge has blocked a Florida law which sought to prevent social media firms from taking down content from political candidates, saying the measure was "wholly at odds with accepted constitutional principles" of free speech.

Judge Robert Hinkle, in a ruling late Wednesday, said the law passed by the Florida legislature and signed by Governor Ron DeSantis distorted the idea of protections by placing restrictions on certain for moderating content.

The measure was approved by the state in response to the "de-platforming" of former president Donald Trump and others by large which critics claim were biased against conservatives and were "censoring" content.

But the judge said the law offered only vague definitions of platforms affected and turned upside-down the notion of First Amendment speech protection in the constitution.

"The state has asserted it is on the side of the First Amendment... It is perhaps a nice sound bite. But the assertion is wholly at odds with accepted constitutional principles," the judge said in a 31-page opinion backing an injunction against the law.

"The First Amendment does not restrict the rights of private entities not performing traditional, exclusive public functions."

The added that the legislation "was an effort to rein in social-media providers deemed too large and too liberal. Balancing the exchange of ideas among private speakers is not a legitimate governmental interest."

The law would impose fines of $250,000 a day if social media firms remove an account of a statewide political candidate.

It also allows Floridians to sue technology firms if they face "unfair" treatment.

Matt Schruers of the Computer & Communications Industry Association, a tech industry trade group which joined the lawsuit, welcomed the ruling.

"This decision upholding the constitution and federal law is encouraging, and reaffirms what we have been saying: Florida's statute is an extraordinary overreach, designed to penalize private businesses for their perceived lack of deference to the government's political ideology."