Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Muslim congregation that has waged a five-year battle against a New Jersey town for the right to build a mosque has moved "one step closer" to finally having a place to pray.

A federal judge ruled that Bernards Township discriminated against the Islamic Society of Basking Ridge by requiring it to provide more parking spots for their proposed mosque than other places of worship in the town.

It was the latest development in a multi-year battle that has involved dozens of public hearings as well as allegations of anti-Muslim animus.

A rendering of the proposed mosque taken from court documents.

"This brings the local community one step closer to have a place of their own in this township," Adeel Abdullah Mangi, an attorney representing the society, told NBC News on Monday."That means everything to the local Muslims."

RELATED: Islamic Group Files Lawsuit Over Denied Mosque After Years-Long Planning Battle, Vandalism

But Bernards Township Mayor Carol Bianchi refused to wave the white flag Monday. She said the township is weighing its next legal move and referred a reporter to her earlier statement criticizing U.S. District Court Judge Michael A. Shipp’s ruling.

“This is a landmark ruling interpreting the Religious Land Use and Institutionalized Persons Act that will have national impact in reaffirming that townships cannot treat applicants differently based on their religion.”

“This decision has major implications for municipal land use boards and their ability to determine the actual off-street parking needs of proposed projects without fear of alleged (religious land-use) violations,” Bianchi's statement read. “The Township vehemently disagrees with the Court’s decision and awaits a full analysis of the 57 page decision by its attorneys, who only learned of the decision on New Year’s Day.”

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Under township rules, churches are required to provide one parking spot for every three pew seats.

Shipp,in his ruling Saturday, concluded the township treated the Muslim group differently from other religious groups by insisting that it provide even more parking. He wrote the three-to-one parking ratio for churches applies equally to mosques and synagogues.

“Viewing the pleadings in the light most favorable to defendants, the court finds that defendants discriminatorily applied the parking ordinance on the basis of religion,” Shipp wrote.

An excerpt of court documents detailing the battle over a proposed mosque in New Jersey.

In oral arguments on Dec. 20, township attorney Howard Mankoff denied the board applied different standards based on religion. He insisted that a mosque is not considered a church under the township definition, adding that “they’re different because they have different needs.”

RELATED: Justice Department Sues New Jersey Township Over Years-Denied Mosque

Mosque worshipers, Mankoff said, would likely be arriving one per car, straight from work, for the most well-attended religious services on Friday afternoons. He argued that the planning board should be allowed some discretion in applying the township parking ordinance.

“This decision has major implications for municipal land use boards and their ability to determine the actual off-street parking needs of proposed projects without fear of alleged (religious land-use) violations.”

In its 2012 application to build the 4,252-square-foot mosque, the society asked for 50 parking spots, based on a maximum attendance of 150 worshipers over the next five to 10 years.

The board, which leaned heavily on the findings of a traffic engineer hired by a group opposed to the mosque, insisted the mosque provide 107 parking spaces.

The New Year’s Eve decision is the latest development in a case that has drawn national attention and prompted the Justice Department to file its own federal suit against Bernards Township in November.

The Islamic society, which has accused the township of bowing to anti-Muslim activists in the community, claimed in its March lawsuit that the stricter parking requirement "laid the groundwork for each of the board's bases for denying (the society’s) preliminary and final site plan approval."

"The property was purchased in November of 2011," Mangi told NBC. "The application was made in April of 2012. At this point we're coming up on five years."

So far the township held a total of 39 public hearings about the mosque, during which time the Islamic Society says it was targeted by bigots, court documents said.

An image of the Islamic Society of Basking Ridge's vandalized mailbox taken from court documents.

Among other things, a flyer made the rounds in the community asking whether terrorist acts are "something they taught in your mosques and at home," and the society's mailbox was defaced with three-inch stickers to change its acronym from "ISBR" to "ISIS," according to the lawsuit.

During its investigation, documents turned over to federal authorities revealed some Bernards Township officials named in the society’s lawsuit used their personal email accounts to allegedly make anti-Muslim statements.

Follow NBC Asian America on Facebook, Twitter, Instagram, and Tumblr.