A judge on Wednesday handed a significant win to AMC Networks in its long-running battle over profits from “The Walking Dead.”

Los Angeles Superior Court Judge Daniel J. Buckley held that the cable network was entitled to define “modified adjusted gross receipts” under the terms of its contracts with profit participants.

Comic creator Robert Kirkman filed the suit in 2017, along with producers Gale Anne Hurd, Glen Mazzara and David Alpert. The suit accused the network of lowballing the fee to license the show from its production arm, AMC Studios.

The suit followed a similar claim from the show’s creator, Frank Darabont, who is seeking nearly $300 million in unpaid profits in a suit in New York. That case — first filed in 2013 — is set to go to trial sometime next year.

In the Los Angeles case, Buckley held a “mini-trial” in February and March to focus on the question of the appropriate MAGR definition. AMC contends that it has been making the correct profit participation payments under its standard definition, and argued that the plaintiffs were urging the judge to rewrite the deal after the fact.

In a 59-page ruling on Wednesday, Buckley ruled that AMC’s position is correct.

“All of the relevant contractual provisions are unambiguous and demonstrate that AMC’s MAGR definition is binding,” the judge wrote.

AMC’s lead attorney, Orin Snyder, hailed the ruling in a statement.

“Today’s decision is a total victory for AMC,” he said. “The judge found in AMC’s favor on all seven issues that were presented at trial and confirmed that AMC honored its contracts and paid Mr. Kirkman and the other plaintiffs what they were owed. As the court found, these plaintiffs had the most sophisticated lawyers and agents in Hollywood and they got what they bargained for. We are now turning our attention to the trial in New York — which involves very similar claims by CAA and Frank Darabont — secure in the knowledge that the first court to hold a trial on these issues ruled completely in AMC’s favor.”

The Los Angeles case will now to trial on the remaining issues, unless the parties can resolve their dispute out of court.