The Supreme Court on Monday struck down a federal law that bars gambling on football, basketball, baseball and other sports in most states, giving states the go-ahead to legalize betting on sports.

The Supreme Court ruled 6-3 to strike down the Professional and Amateur Sports Protection Act. The 1992 law barred state-authorized sports gambling with some exceptions. It made Nevada the only state where a person could wager on the results of a single game.

One research firm estimated before the ruling that if the Supreme Court were to strike down the law, 32 states would likely offer sports betting within five years.

“The legalization of sports gambling requires an important policy choice, but the choice is not ours to make. Congress can regulate sports gambling directly, but if it elects not to do so, each state is free to act on its own. Our job is to interpret the law Congress has enacted and decide whether it is consistent with the Constitution. PASPA is not,” Justice Samuel Alito wrote for the court.

The court’s decision came in a case from New Jersey, which has fought for years to legalize gambling on sports at casinos and racetracks in the state.

More than a dozen states had supported New Jersey, which argued that Congress exceeded its authority when it passed the 1992 Professional and Amateur Sports Protection Act, barring states from authorizing sports betting. New Jersey said the Constitution allows Congress to pass laws barring wagering on sports, but Congress can’t require states to keep sports gambling prohibitions in place.

All four major U.S. professional sports leagues, the NCAA and the federal government had urged the court to uphold the federal law. In court, the NBA, NFL, NHL and Major League Baseball had argued that New Jersey’s gambling expansion would hurt the integrity of their games. Outside court, however, leaders of all but the NFL have shown varying degrees of openness to legalized sports gambling.

Shortly after news broke regarding the Supreme Court’s decision, Major League Baseball Players Association Executive Director Tony Clark issued a statement with disapproval.

“The Court’s decision is monumental, with far-reaching implications for baseball players and the game we love,” Clark said. “From complex intellectual property questions to the most basic issues of player safety, the realities of widespread sports betting must be addressed urgently and thoughtfully to avoid putting our sport’s integrity at risk as states proceed with legalization.”

The American Gaming Association, which estimates that Americans illegally wager about $150 billion on sports each year, called the decision a “victory” and said the ruling will make it possible for governing bodies to have an “open, transparent and responsible market for sports betting.”

“Through smart, efficient regulation this new market will protect consumers, preserve the integrity of the games we love, empower law enforcement to fight illegal gambling, and generate new revenue for states, sporting bodies, broadcasters and many others,” American Gaming Association President and CEO Geoff Freeman said in a statement. “The [American Gaming Association] stands ready to work with all stakeholders – states, tribes, sports leagues, and law enforcement – to create a new regulatory environment that capitalizes on this opportunity to engage fans and boost local economies.”

The 1992 law at issue in the case bars state-authorized sports gambling with exceptions for Nevada, Montana, Oregon and Delaware, states that had approved some form of sports wagering before the law took effect. Nevada is the only state where a person can wager on the results of a single game, though the law doesn’t cover wagering between friends. The law also doesn’t cover animal races, such as horse racing, which many states already allow.

New Jersey has spent years and millions of dollars in legal fees trying to legalize sports betting at its casinos, racetracks and former racetracks. In 2012, with voters’ support, New Jersey lawmakers passed a law allowing sports betting, directly challenging the 1992 federal law which says states can’t “authorize by law” sports gambling. The four major professional sports leagues and the NCAA sued, and the state lost in court.

In 2014, New Jersey tried a different tactic by repealing laws prohibiting sports gambling at casinos and racetracks. It argued taking its laws off the books was different from authorizing sports gambling. The state lost again and then took the case to the Supreme Court.

Contributing: Madeline Kenney