A court on Tuesday issued an injunction barring Netflix from poaching employees from Fox and confirming the validity of fixed-term employment agreements.

The ruling marks a hard-fought victory for Fox — now owned by Disney — which set out three years ago to stop Netflix from raiding its employees. Netflix had sought to invalidate Fox’s fixed-term employment contracts, arguing that they locked employees into jobs they no longer wanted.

Had Netflix prevailed, it would have upended a standard industry practice and given employees greater leverage in negotiations with their employers.

“I was kind of shocked Netflix did this broad attack on term contracts,” said attorney Schuyler Moore, a partner at Greenberg Glusker LLP. “It was kind of arrogant on Netflix’s part to say they’re going to spit in the face of the studios.”

Santa Monica Superior Court Judge Marc Gross issued a tentative ruling on Nov. 25 indicating how he was likely to rule in the case. He affirmed the conclusions of the tentative opinion and made addition points in his final ruling on Tuesday.

Netflix has indicated it is likely to appeal.

“The court’s ruling today brings to an end years of unlawful practices by Netflix,” said attorney Daniel Petrocelli, who argued the case for Fox. “The decision not only condemns Netflix’s deliberate violations of the law, but just as importantly reaffirms and protects the rights and choices of employees.”

The case began when Netflix hired Fox executives Marcos Waltenberg and Tara Flynn in late 2015 and summer of 2016, respectively, doubling each of their salaries.

Both employees were on two-year contracts with Fox, which had not yet expired. Fox also had the unilateral option to extend those contracts for another two years. The contracts barred each employee from seeking work elsewhere, and gave Fox the right to get an injunction if either employee breached the agreement.

Fox filed suit in September 2016, accusing Netflix of inducing its employees to breach their agreement. Netflix argued that it expected the employees would be let out of their agreements, and that the agreements were unenforceable. Netflix argued that by giving the employer the unilateral ability to extend the contracts, Fox had run afoul of California’s “seven-year rule,” which bars contacts of terms longer than seven years.

Gross disagreed.

“The undisputed facts show Netflix intentionally interfered with Fox’s contracts with Waltenberg and Flynn,” he wrote. “In doing so, Netflix arguably sought to further its own economic interest at Fox’s expense, and such conduct is not justified.”

The ruling has been closely watched among Hollywood employment lawyers.

“This decision sends a very clear message — these fixed-term contracts are valid and so are unilateral option rights,” said Devin McRae, an attorney at Early Sullivan. “A lot of people have assumed that if I want to leave I can leave. The effect of the opinion will probably be to inhibit employee mobility.”

Gross did not grant Fox’s request for $1 in damages, saying that the amount of damages — if any — should be left to a jury. A trial is currently set for Jan. 27, though it is unlikely to go forward.

Netflix repeated what it said after the Nov. 25 tentative ruling:

“As Judge Gross ruled, Fox failed to prove it was hurt in any way when two executives decided to exercise their right to go to Netflix. Fox’s illegal contracts force employees to remain trapped in jobs they no longer wish to do and at salaries far below market rate. We will continue to fight to make sure that people who work in the entertainment industry have the same rights as virtually every other Californian and can make their own choices about where they work.”