A Florida judge on Friday blocked a new law that would have dissolved Walt Disney World's special tax status, a major victory for the entertainment giant.

The law, which was passed by the Republican-controlled state legislature in April, was in retaliation for Disney's opposition to a new law that bans the teaching of sexual orientation and gender identity in kindergarten through third grade.

Disney had argued that the law would have cost the company billions of dollars in taxes and would have made it difficult to operate its theme parks in Florida.

The judge, who was appointed by former Republican Gov. Rick Scott, said that the law violated the state constitution's guarantee of due process.

The ruling is a major setback for Gov. Ron DeSantis, who had championed the law. DeSantis is expected to appeal the ruling to the Florida Supreme Court.