NEW YORK — The New York Police Department’s intelligence unit did not discriminate against Muslims with far-reaching surveillance aimed at identifying ‘‘budding terrorist conspiracies’’ at Newark mosques and other locations in New Jersey, a federal judge ruled on Thursday.

In a written decision filed in federal court in Newark, US District Judge William Martini dismissed a civil rights lawsuit brought in 2012 by eight Muslims who alleged the NYPD’s surveillance programs were unconstitutional because they focused on religion, national origin, and race. The suit had accused the department of spying on ordinary people at several mosques, restaurants, and grade schools in New Jersey since 2002.

The plaintiffs, including the former principal of a grade school for Muslim girls, ‘‘have not alleged facts from which it can be plausibly inferred that they were targeted solely because of their religion,’’ Martini wrote, adding
‘‘the police could not have monitored New Jersey for Muslim terrorist activities without monitoring the Muslim community itself.’’

Advertisement

A similar lawsuit filed in federal court in Brooklyn is still pending.