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: Schwarber Hits 3-Run HR, Harper-Less Phils Beat Padres 8-5

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: Viewing Underway For Fallen Firefighter Lt. Sean Williamson In South Philadelphia: 'It's A Terrible Tragedy'

The mosque’s attorney, Adeel Mangi, called the decision a “landmark ruling.” 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: Family, Friends Hold Celebration Of Life Event For Delco Man That Drowned In Wildwood