The U.S. Supreme Court announced Tuesday that it will hear New Jersey’s appeal to offer legal sports betting, a surprising twist in the state’s nearly five-year battle with the major American sports leagues.

A victory for New Jersey would allow the state to offer legal sports betting at its casinos and racetracks and potentially jump-start a state-by-state expansion across the nation. Tuesday’s decision was the first setback for the NCAA, NFL, NBA, NHL and MLB in the lengthy saga. The leagues twice sued New Jersey Gov. Chris Christie after he signed sports betting legislation in 2012 and 2014.

New Jersey had lost every step of the way, and it was considered unlikely that the high court would hear its case. In May, Solicitor General Jeffrey Wall submitted an opinion advising the Supreme Court to pass on the case. The court normally follows Department of Justice recommendations.

The Supreme Court will now take a close look at the Professional and Amateur Sports Protection Act of 1992, the federal prohibition on state-sponsored sports betting.

It could hear the case as early as this fall, but experts believe a more likely timetable is sometime this winter, with a decision in late spring or early summer.

PASPA restricts legal sports betting to a handful of states, with only Nevada being able to offer a full menu. In 2016, more than $4.5 billion was bet at Nevada sportsbooks. More states have expressed interest in getting into the sports betting game and will be watching the case closely.

The sports betting landscape in the U.S. has shifted significantly over the past five years as the New Jersey case has played out. The NBA has pivoted its position on sports betting, and the NFL and NHL have elected to place franchises in Las Vegas. MLB has begun to align itself with the NBA on the issue, along with other professional sports leagues such as MLS and the PGA. The NCAA and NFL remain opposed to expanding legal sports betting, and the NHL has mostly remained quiet on the prospect in recent years.

The issue doesn’t appear to be going away, though. A congressional committee has already introduced draft legislation that aims to repeal PASPA.