(Bloomberg) -- A federal judge in New Jersey temporarily blocked a new state law restricting the carrying of concealed firearms in parks, bars, casinos and other public places from going into effect. 

US District Judge Renée Marie Bumb in Camden on Monday issued an injunction against the law in a suit brought by gun-rights advocates who are challenging its constitutionality. Bumb said she was issuing the order because the suit was likely to ultimately succeed.

“The threat of criminal prosecution for exercising their Second Amendment rights, as the holders of valid permits from the state to conceal carry handguns, constitutes irreparable injury on behalf of plaintiffs, and neither the State nor the public has an interest in enforcing unconstitutional laws,” wrote Bumb, an appointee of former President George W. Bush.

New Jersey Attorney General Matthew Platkin said in a statement that Bumbe’s ruling undermines “longstanding protections” against gun violence in public spaces and vowed to appeal.

The decision is “bad for public safety and inconsistent with the Second Amendment,” said Platkin. “But these orders remain temporary, and we look forward to pressing our case, including ultimately on appeal.”

Blue states have rushed to pass location-specific gun laws since the US Supreme Court ruled last year that most restrictions on concealed-carry permits violated the Second Amendment. The new laws, which greatly expand the number and types of public places where guns are prohibited, have also been challenged as unconstitutional.

A federal judge in October ruled that a New York law barring concealed firearms from Times Square and many other public spaces was largely unconstitutional, but his decision was put on hold while the state appeals.

In both the New York and New Jersey cases, the judges said bans on firearms in public places could not be justified by historical practice. The Supreme Court’s conservative majority in its concealed-carry decision likewise cited early US history in finding that permit restrictions violated the Second Amendment.

Monday’s ruling means individuals with concealed-carry permits in New Jersey may continue to bring hidden firearms into many so-called sensitive places including parks, beaches, libraries, restaurants and bars. Bumbe also temporarily blocked a provision that would ban functional firearms in vehicles.

The litigation was brought by groups including the Second Amendment Foundation and Firearms Policy Coalition Inc. State Senator Ed Durr, a Republican, said in a statement that the law should never have been passed.

“Had Democrats listened to any of the concerns we raised when they rushed the bill through the Legislature, they could have saved themselves the embarrassment, and taxpayers the cost, of defending a clearly unconstitutional law in federal court,” said Durr.

The case is Koons v. Reynolds, 22-cv-07464, US District Court, District of New Jersey.

(Updates with comment from the NJ attorney general)

©2023 Bloomberg L.P.