In a significant victory for Gov. Ron DeSantis of Florida, a federal judge on Wednesday dismissed a lawsuit brought by the Walt Disney Company alleging that DeSantis and his allies violated the First Amendment by taking over a special tax district encompassing Walt Disney. World.

Disney said it planned to appeal the ruling.

Disney and DeSantis, who recently ended his campaign for president, have been at odds for nearly two years over Disney World, the 25,000-acre theme park and resort south of Orlando. Angered by Disney’s criticism of a Florida education law that his opponents called anti-gay, and seizing an opportunity to score political points with his supporters, DeSantis took over the tax district, appointed a new board and ended the the company’s long-standing ability to self-govern Disney World as if it were a county.

However, before the acquisition took effect, Disney signed contracts (quietly, but in publicly announced meetings) to secure development plans worth about $17 billion over the next decade. An effort by DeSantis and his allies to void the contracts led to dueling lawsuits: Disney sued DeSantis and the tax district in federal court and the new appointees returned fire in state court.

On Wednesday, Judge Allen Winsor of the U.S. District Court for the Northern District of Florida in Tallahassee dismissed Disney’s case in its entirety. The lawsuit had accused DeSantis of a “relentless campaign to weaponize government power against Disney in retaliation for expressing a political point of view.” The campaign, the company had added, “now threatens Disney’s business operations, jeopardizes its economic future in the region and violates its constitutional rights.”

But Judge Winsor concluded that the law giving Mr. DeSantis control of the special tax district was written in a way that, on its face, did not allow Disney to claim retaliation, primarily because Disney was not the only landowner affected.

“It is settled law that ‘when a statute is apparently constitutional, a plaintiff cannot challenge free speech by alleging that the legislators who passed it acted for a constitutionally impermissible purpose,’” he wrote in his ruling.

Judge Winsor, appointed by President Donald J. Trump in 2019, added that Disney “faces the brunt of the harm” from the law, but not all, saying, “There is no ‘close enough’ exception.”

His ruling aligned with arguments made in December hearings by DeSantis’ lawyers: that it didn’t matter whether the governor’s action was retaliatory, only whether the subsequent state law stripping Disney of control was constitutional.

In a statement, Disney said: “This is an important case with serious implications for the rule of law, and it will not end here. “If left unchallenged, this would set a dangerous precedent and give states license to weaponize their official powers to punish the expression of political views with which they disagree.”

DeSantis and the fiscal district took victory laps.

“The corporate reign is over,” Jeremy Redfern, the governor’s spokesman, said in a statement. “The days of Disney controlling his own government and being above the law are long gone.”

Martin Garcia, a DeSantis ally who took over last year as DA chairman, said in an email that he was “delighted” with the ruling and vowed to move forward with “appropriate changes” to the way government services at Disney The world was managed.

An attorney for the taxing district, Charles J. Cooper, added in a statement that “Disney may own the land in the district, but it does not own the government.”

As part of his 17-page ruling, Judge Winsor said Disney had also failed to show “any specific harm” from the actions of the new tax district board. The only detriment, he said, is that Disney now must operate “under a board it can’t control,” which isn’t enough.

While a significant setback for Disney, the ruling is unlikely to have an immediate impact on the relationship between the company and the supervisory board. The state lawsuit is still active.

A state judge, Margaret Schreiber, denied Disney’s motion to dismiss the countersuit. In November, however, she agreed to Disney’s request to Push the next phase of the state case through March.; Disney had accused the district attorney of dragging its feet in fulfilling discovery requests.

Disney has since filed a related lawsuit in state court accusing the district of failing to comply with public records requests.

The tax district, created in 1967, was a crucial tool in the development of Disney World because it gave Disney unusual control over building permits, fire protection, surveillance, road maintenance and development planning. Today, Disney World comprises four theme parks, two water parks and 18 Disney-owned hotels with 267 pools. The resort employs approximately 75,000 people and attracts about 50 million visitors a year.

The growth plan that Disney put in place before DeSantis and his allies took control of the district, and which is at the center of the state court battle, involves the possible construction of 14,000 additional hotel rooms, a fifth theme park important and three small ones. parks. The company has said it has committed more than $17 billion in spending to fuel the complex’s growth over the next decade, an expansion that would create approximately 13,000 jobs at the company.

But Disney has threatened to scale back its ambitions in Florida, depending on the outcome of its tax district fight.

Calling DeSantis “anti-business” for his campaign against the company, Disney last year canceled an office complex scheduled to be built in Orlando at a cost of about $1 billion. It would have added more than 2,000 Disney jobs in the region, with an average salary of $120,000, according to an estimate by the Florida Department of Economic Opportunity.

DeSantis has loved campaigning and fundraising against what he calls “woke” corporations (mainly Disney), as well as targeting certain books and the former top prosecutor in Tampa, Florida, whom he removed from office.

Disney had found hope for its own First Amendment case in a recent court ruling involving Andrew H. Warren, the Tampa prosecutor. This month, the conservative 11th Circuit Court of Appeals in Atlanta ruled in favor of Warren, who has been suing to get his job back, citing First Amendment protections.

“The state cannot exercise its coercive power to censor so-called ‘woke’ speech with which it disagrees,” wrote Kevin C. Newsom, one of the appeals court judges.