TAMPA (WFLA) – A federal judge Wednesday put on hold a first-of-its-kind law in Florida that authorized the state to penalize social media companies when they ban political candidates, a win for social media companies as they try to keep control of their platforms.

U.S. District Judge Robert Hinkle issued a preliminary injunction blocking enforcement of the law, which was scheduled to go into effect Thursday.

Hinkle said the law’s ban on “deplatforming” likely violated the free speech rights of the tech companies, which under the First Amendment are generally free to decide what to publish without government interference.

“The legislation compels providers to host speech that violates their standards — speech they otherwise would not host — and forbids providers from speaking as they otherwise would,” he wrote.

Referring to the sweeping scope of the law, he added: “Like prior First Amendment restrictions, this is an instance of burning the house to roast a pig.”

The law stated that a platform may not “permanently delete or ban” a candidate for office. Suspensions of up to 14 days are allowed under the law, and a service could still remove individual posts that violate its terms of service.

The state’s election commission power to fine media companies up to $250,000 a day for “deplatforming” any candidate for statewide office, and $25,000 per day for de-platforming candidates for non-statewide offices.

The legislation is an apparent nod to President Donald Trump, who was banned from Twitter and Facebook earlier this year.