BERNARDS — A second Somerset County town will pay millions of dollars as a result of having denied an Islamic group permission to build a mosque.

The $3.25 million settlement was announced Tuesday by the U.S. Justice Department, which had sued Bernards after its Planning Board denied an application to build a mosque in December 2015.

As a result of the settlement, the Islamic Society of Basking Ridge will be allowed to build its mosque on the 4-acre plot on Church Street in the Liberty Corner section of the township.

The Islamic Society had also sued the township when its mosque application was denied after more than three dozen land-use board meetings over four years. That lawsuit also was settled.

The mosque was already a permitted use in residential areas of the township, which has 10 houses of worship but no mosques.

In 2014, Bridgewater paid $7.5 million to settle a lawsuit after officials rejected a proposal to turn a former banquet hall into an Islamic community center.

In both communities, land-use board meetings, public demonstrations, and online postings were peppered with comments critical of Muslims and their faith.

Bernards continues to deny that officials discriminated based on religion.

The Township maintains that the denial of the Planning Board was based on accepted land use criteria only," township spokesman Michael Turner said Tuesday. "Indeed, Bernards Township is a diverse and inclusive community, where for years the ISBR congregation have practiced their religion along with their neighbors unimpeded, using township facilities at the Bernards Township Community Center and at Dunham Park.

"This is the end of a long engagement on the application and opinions may still be varied, but it is in the best interest of the Township to conclude the litigation.”

Elsewhere in New Jersey, Muslims are suing Bayonne in federal court after the city's Zoning Board this year denied an application to turn a vacant warehouse in an industrial part of town into a mosque. The Bayonne Muslims' lawsuit says the denial was the result of “explosive hostility” and anti-Muslim bigotry.

On Tuesday, a spokesman for the U.S. Attorney's Office of New Jersey said the Department of Justice has opened a formal investigation into Bayonne's handling of the mosque application.

Federal officials said Bernards denied the application using parking standards it had not applied to other houses of worship. The federal complaint also said Bernards amended its land use ordinance in a way that imposed unreasonable limitations on all religious institutions.

Also as part of the settlement:

— Township employees and officials will have to be trained on the federal Religious Land Use and Institutionalized Persons Act.

— The township will have to publicize its non-discrimination policies in local newspapers.

— The Township Committee will have to amend its zoning ordinance to limit restrictions on housings of worship.

The president of the Islamic Society, Ali Chaudry, a former mayor of the township, said the group was "very pleased by this resolution."

"We look forward to welcoming people of all faiths and backgrounds to our mosque. Our doors will be open to anyone interested in building bridges to promote harmony in the community and peace in the world," Chaudry said Tuesday in a prepared statement.

The attorney for the Islamic group said the settlement should put other municipalities on notice.

“The American Muslim community has the legal resources, the allies, and the determination to stand up for its constitutional rights in court and will do so," said Adeel A. Mangi, whose firm, Patterson Belknap Webb & Tyler, will be donating its legal fees from this case to charity.

Sergio Bichao is deputy digital editor at New Jersey 101.5. Send him news tips: Call 609-359-5348 or email sergio.bichao@townsquaremedia.com.