LEONIA, N.J. (AP) — A New Jersey town plans to seek to reverse a judge's ruling striking down its ordinance that banned nonresident drivers from using some of its streets as shortcuts to a heavily traveled bridge into New York.

Leonia adopted an ordinance in January in response to traffic congestion and safety issues caused by navigation apps sending motorists through town to the George Washington Bridge.

A resident of a nearby town sued shortly after the road closures went into effect, and in the spring, New Jersey's attorney general said the closures "weren't legally valid."

On Thursday, a state Superior Court judge found that Leonia failed to get the required permission for the road closures from the state Department of Transportation. The DOT commissioner must sign off on laws that affect a state roadway, and many of Leonia's closures were near Grand Avenue, the local section of state Route 93.

Leonia Mayor Judah Zeigler said in an email that the town would seek an immediate stay of the judge's order and also would appeal. He said Judge Peter Bariso's ruling "makes it clear that Leonia had the right to enact the regulations that were adopted and, if the streets adjacent to Grand Avenue had not been included in the ordinance, there would be no legal issue."

Zeigler said the borough would introduce new ordinances next week and that he wants "to do everything possible to work with the Department of Transportation."

Attorney Jacqueline Rosa, who sued the borough over the closures in February, on Thursday called the judge's ruling "fantastic" for commuters.

Apps like Waze and Apple Maps reroute some of the tens of thousands of vehicles headed to the George Washington Bridge each morning, particularly when there is an accident or other disruption. Police said in January that studies have shown more than 2,000 vehicles often pass through town of about 9,000 residents from just one of the three exits off Interstate 95, causing safety concerns and gridlock on side streets.

A few weeks after the ordinance went into effect, the town replaced "Do Not Enter" signs with what it called "less menacing" signs after local business owners expressed concerns about losing business.

More than 140,000 vehicles cross the George Washington Bridge each day. The bridge was the site of a political scandal in 2013 when aides to Republican then-Gov. Chris Christie were accused of deliberately closing access lanes and causing traffic jams to spite the Democratic mayor of Fort Lee for not endorsing him. Christie denied any knowledge of the scheme, but three people close to him either pleaded guilty or were convicted at trial.