NEWARK, N.J. (AP) — A federal judge says an upscale New Jersey town violated anti-discrimination laws by insisting that a proposed mosque have more parking spaces than churches or synagogues.

The judge on Saturday ruled that Bernards Township violated the Religious Land Use and Institutional Persons Act by applying a different standard to Muslims.

READ MORE: President Biden To Visit Lehigh County On Wednesday, Visit Mack Trucks In Lower Macungie

He said the township’s planning board had “unbridled and unconstitutional discretion” due to its vague parking requirements.

The Islamic Society’s application to build the mosque was denied after more than three years and 39 public hearings. The group sued the township in March.

READ MORE: 5 Things We 'Think' We Know As Philadelphia Eagles Hold First Training Camp Practice Of Nick Sirianni Era

The mosque’s attorney, Adeel Mangi, called the decision a “landmark ruling.”

NJ.com reports township officials say they “vehemently” disagree with the decision and will decide how to proceed after the township’s attorneys study it.

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

MORE NEWS: Former Atlantic County Child Protective Services Worker Kayan Frazier Sentenced For Child Porn