MINNEAPOLIS -- A federal judge handed NFL players a key ruling Tuesday in their fight to strip the league of $4 billion in TV revenue they contend was unfairly and illegally secured as a way to survive a lockout that could begin by the end of the week.

U.S. District Judge David Doty backed the NFL Players Association in its closely watched fight over the so-called "war chest" of broadcast revenue that the union contends is leverage the NFL is wielding against it in the labor fight.

The NFL's current collective bargaining agreement expires at midnight Eastern time Thursday night.

In his 28-page ruling, Doty criticized special master Stephen Burbank for legal errors and erroneously concluding earlier this month that the NFL can act like a self-interested conglomerate when in fact it is bound by legal agreements to make deals that benefit both league and player.

Doty instead declared that the NFL violated its agreement with the union, which had asked that the TV money be placed in escrow until the end of any lockout. A hearing, yet to be scheduled, will be held to determine potential damages for the players as well as an injunction involving the TV contracts.

NFL spokesman Greg Aiello downplayed the significance of the ruling, saying the 32 teams were "prepared for any contingency."

"Today's ruling will have no effect on our efforts to negotiate a new, balanced labor agreement," Aiello said. He told The Associated Press that the NFL had not immediately determined whether it would appeal.

The case, however, has billions at stake.

The union accused the NFL of failing to secure the maximum revenue possible when it restructured broadcast contracts in 2009 and 2010, and claimed the deals were designed to guarantee owners enough money to survive a lockout. The union argued this violated an agreement between the sides that says the NFL must make good-faith efforts to maximize revenue for players.

Doty agreed.

"The record shows that the NFL undertook contract renegotiations to advance its own interests and harm the interests of the players," wrote the judge, who has overseen NFL labor issues since he presided over the 1993 decision that cleared the way for the current free agency system.

Doty cited an NFL "Decision Tree" as a "glaring example" of the league's intent, and quoted from it: "Moving forward with a deal depended on the answer to the questions: 'Does Deal Completion Advance CBA Negotiating Dynamics?' If yes, the NFL should 'Do Deal Now'; if no, the NFL should 'Deal When Opportune.'"