A federal appeals court on Tuesday overturned New Jersey's sports betting law for the second time in two years, saying federal statutes forbid gambling on college and professional sports except in a handful of states.

New Jersey voters amended the state constitution in 2011 to permit sports betting at struggling casinos and racetracks while barring wagers on New Jersey college teams or on any collegiate event occurring in the state.

The National Collegiate Athletic Association, the National Basketball Association, the National Football League, and others sued to prevent implementation of the plan.

The U.S. Court of Appeals for the Third Circuit, sitting in Philadelphia, overturned New Jersey's sports betting law for the first time in 2012.

The New Jersey Legislature then amended its law in an effort, lawmakers said, to conform with the decision.

But in a 2-1 vote, a three-judge panel of the Third Circuit said Tuesday that was not good enough. Voting to uphold the ban were Judges Marjorie Rendell and Maryanne Trump Barry.

Judge Julio M. Fuentes dissented.

Despite the outcome, New Jersey officials said they were undeterred and would appeal the panel's decision to the entire Third Circuit court. "We will continue our fight for what New Jersey voters clearly stated they desire, a legal way to wager on competitive sports," Senate President Stephen Sweeney said.

The opinion upheld the 2014 decision by a federal district court, finding that the New Jersey sports gambling law violated federal law.

The appeals panel said that by permitting sports betting, New Jersey had violated the Professional and Amateur Sports Protection Act, a 1992 federal law that limited sports betting to Nevada, Montana, Delaware, and Oregon. Under the law, New Jersey had a narrow window in 1993 to enact a sports betting plan, but it failed to do so.

The Third Circuit said that New Jersey might yet be able to institute sports betting, but that it would have to be done by an act of Congress.

"Just as PASPA once gave New Jersey preferential treatment in the context of gambling on sports, Congress may again choose to do so," said the majority opinion by Rendell.

New Jersey officials from Gov. Christie on down have made it clear that the gambling initiative was aimed at bolstering the state's flagging casino industry.

Proponents have argued that sports betting could generate as much as $225 million a year for casinos and racetracks.

In its opinion, the Third Circuit acknowledged New Jersey's need for revenue, but went on to say that federal gambling statutes flatly prohibit sports betting in New Jersey.

The case turned on technical legal arguments over how to interpret the New Jersey law.

In its first attempt to authorize sports betting, in 2011, the Legislature repealed laws banning sports betting and set up a detailed regulatory apparatus. That law was struck down by a federal district court judge, and New Jersey appealed, arguing that the federal ban was unconstitutional. The Third Circuit upheld the lower court, and the U.S. Supreme Court declined to hear an appeal by New Jersey.

In 2014, the New Jersey Legislature tried to institute sports betting again, this time by simply repealing the prohibition, without establishing a regulatory scheme. Lawyers for the state argued in the current case that the federal government had no authority to stop it from repealing a law.

But the Third Circuit said the action had the same effect: It authorized sports betting in New Jersey, though it is illegal under federal law.

Despite a flourishing sports betting industry centered in Nevada that totals as much as $350 billion a year, the sports leagues challenged New Jersey's gambling statute by arguing that it would undermine the integrity of professional and collegiate athletics.