A U.S. District Judge in Trenton, N.J., granted a temporary restraining order to the NCAA, NFL, NBA and other major professional sports leagues Friday, crushing a New Jersey racetrack's hopes of offering legal sports betting this weekend.

After a week of rapid-fire legal filings, Judge Michael Shipp ruled the sports leagues would suffer irreparable harm if thoroughbred track Monmouth Park began accepting sports bets Sunday as planned.

The ruling is a blow for New Jersey, which is trying desperately to help its ailing gaming industry. Four Atlantic City casinos have closed, and thousands of workers have been laid off.

New Jersey believes Las Vegas-style sports betting would provide a spark and has been battling the leagues for more than two years.

But this case still isn't over. More hearings in district court and the Third Circuit Court of Appeals are expected. Both courts have previously ruled against New Jersey's sports betting efforts.

Before it's over, the Department of Justice also could weigh in. For now, though, the NCAA, NFL, NBA, NHL and MLB have stopped bettors from legally wagering on their games in New Jersey.

"It's incredibly disappointing," New Jersey State Senator Raymond Lesniak said. "It's very, very important to both our casinos and racetracks, so we're going to continue to pursue it."

When contacted by ESPN after the ruling, the NFL and NBA declined comment.

The leagues filed suit Monday, asking for a permanent injunction and claiming New Jersey's latest sports betting legislation, the 2014 Sports Wagering Law, violates the Professional and Amateur Sports Protection Act of 1992 (PASPA). PASPA prohibits states from "authorizing, operating, advertising, promoting or licensing" sports betting in all but four states: Nevada, Delaware, Montana and Oregon.

Last week, New Jersey Gov. Chris Christie signed the Sports Wagering Law. It partially repeals the state's sports betting prohibitions, but restricts it to racetracks and casinos and to adults 21 or older. It also prohibits wagering on games involving state colleges and universities and any collegiate games played in New Jersey. In legal filings, the sports leagues pointed to those stipulations as evidence the state is still authorizing sports betting.

"Despite its 'repeal' language, the 2014 Sports Wagering Law is a blatant attempt by the State of New Jersey to sponsor, operate, advertise, promote, license and/or authorize sports gambling in Atlantic City casinos and at New Jersey racetracks," attorneys for the five sports leagues wrote in Monday's complaint. "As such, the 2014 Sports Wagering Law violates PASPA."

New Jersey lead attorney Ted Olson, a former U.S. Solicitor General, disagreed. In a legal brief opposing the restraining order, Olson and state attorneys wrote that the 2014 Sports Wagering Law does exactly what the Third Circuit Court of Appeals and Department of Justice attorneys said it could in a ruling last September.

"To follow the Third Circuit's interpretation of PASPA, the Repealer [2014 Sports Wagering Act] expressly states that it is 'not intended and shall not be construed as causing the State to sponsor, operate, advertise, promote, license, or authorize by law or compact the placement or acceptance' of a sports wager," state attorneys wrote.

The arguments will continue in the near future as Shipp decides whether to grant the leagues' request for a permanent injunction.

Monmouth Park has spent the last month and a half preparing to turn its sport bar and restaurant into a sportsbook. It has hired employees and formed an independent regulation committee, the Independent Sports Association.

The park was expecting thousands of bettors to attend Sunday.