NEW YORK (Reuters) - A New Jersey town has reached a settlement with the U.S. government and a local Islamic group to resolve allegations that the town illegally denied plans for a proposed mosque.

Officials in Bernards Township voted 4-1 on Tuesday night to approve settling lawsuits filed by the U.S. Department of Justice and the Islamic Society of Basking Ridge, according to a spokesman for the town, Michael Turner.

Turner did not comment on the details of the settlement, which will not be made public until the agreement is filed with a federal judge in New Jersey.

The Justice Department lawsuit, filed in November in the waning days of the Obama administration, said the town’s planning officials deliberately set out impossibly strict requirements that the Islamic Society could not meet, following objections from members of the public based on religious bias.

“The reasons set forth by the Planning Board for denying the site plan application were pretextual, and the Planning Board in fact denied the application based on discrimination toward Muslims,” the lawsuit said.

Amid opposition from some residents, the mosque’s mailbox was vandalized, with the letters ISBR changed to ISIS in a reference to the militant group Islamic State, the government said.

The Islamic Society, which currently holds prayer services in rented space at a community center, spent four years trying to get approval for a permanent building, including 39 separate hearings, according to the government’s lawsuit. The group brought its own lawsuit earlier in 2016, and a number of religious freedom and civil rights groups have filed briefs in support of the complaint.

Bernards Township, about 30 miles (48 km) west of New York City, has a population of approximately 27,000.

A lawyer for the Islamic Society and a Justice Department spokesman declined to comment, saying the agreements have not yet been filed in court.

The firm that represented the group, Patterson Belknap Webb & Tyler, filed a separate lawsuit on Thursday against Bayonne, New Jersey, claiming the town employed bogus reasons to deny an application to build a new mosque.

The U.S. government, meanwhile, has other pending lawsuits against localities over denials of mosques, including Bensalem, Pennsylvania; Des Plaines, Illinois; and Culpepper County, Virginia.

The complaints are based on a federal law that bars local governments from imposing land use regulations that place undue burdens on the right of religious free exercise.