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.

The NFL and NBA did not immediately return requests for comment regarding Tuesday’s decision. Major League Baseball declined comment.

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.

“The citizens of New Jersey overwhelmingly support legalized sports betting and acted in a referendum to show that support,” Rep. Frank Pallone, who is leading the PASPA repeal legislation said in a statement Tuesday. “Both Congress and the Supreme Court should respect these actions. Rather than continuing to allow criminal and offshore entities to reap the benefits of illegal gaming, there is now an opportunity for the Supreme Court to allow the democratic process in New Jersey to appropriately regulate sports gaming.”

New Jersey State Sen. Raymond Lesniak, who has spearheaded the sports betting effort, believes the leagues will now be open to negotiating.

“I do believe we may start talking turkey (with the leagues),” Lesniak told ESPN. “After years of being knocked down and getting up again to fight the NFL one more time, we’re now on the brink of victory.”