Updated

Federal law enforcement officials are investigating a New Jersey city that prevented a Muslim group from building a mosque, a rejection that the group said was motivated by religious hatred.

Matthew Reilly, a spokesman for the U.S. attorney's office in New Jersey, confirmed that it is investigating after Bayonne rejected the mosque's application. The Department of Justice on Tuesday unveiled a $3.25 million settlement between a different New Jersey town and an Islamic group — a deal that requires the town to allow a mosque to be built after a similar zoning dispute.

The Bayonne Muslims filed a federal lawsuit against the city and its zoning board last week arguing that their two-year effort to convert an abandoned warehouse into a mosque and community center was met by virulent attacks against their religion and then unfairly voted down by a zoning board.

The zoning board in the working-class city across the harbor from New York City voted 4-3 in favor of the mosque proposal in March, but it needed a minimum of five votes to pass. Those who voted against it cited parking and traffic concerns, although the Bayonne Muslims say that the building is located in an uncongested part of the city with ample parking.

The Bayonne Muslims' lawsuit takes issue with the zoning board's reasoning for its denials, but also lays out the anti-Muslim attacks they were faced with after proposing the community center.

They say that included flyers calling for boycotts of Muslim-owned businesses with references to the Sept. 11 attacks and anti-Muslim graffiti on the walls of the church they rented for prayer services. Signs saying "Save Bayonne" and "Stop the mosque" were displayed around the town.

At one zoning board hearing, a group began loudly reciting a Christian prayer while a group of Muslim attendees was praying quietly in a corner, the suit says. One person argued to the zoning board that the mosque should be denied because people would become radicalized and kill people, while another said that the Muslim' beliefs should be carefully examined, according to the suit.

WNYC-FM was the first to report on the federal investigation.

In the other case, The Islamic Society of Basking Ridge sued Bernards Township, an upscale town in central New Jersey, last year, claiming it changed its zoning ordinances in order to deny the group's plans. The Justice Department also sued the town last year, alleging it treated the group differently than other religious groups.

The $3.25 million is to settle the Islamic Society's lawsuit against the town, split into $1.75 million for attorneys' fees and costs and $1.5 million for damages.

Through a spokesman, the township committee denied discriminating against the Islamic Society and maintained the denial of the group's proposal was "based on accepted land use criteria only." It noted that the group's members have used other township facilities to practice their religion for years.

A similar lawsuit cost nearby Bridgewater Township almost $8 million in a 2014 settlement.