A group of Muslims from New Jersey is appealing a federal judge's ruling that determined that the New York City Police Department's surveillance of Muslims did not violate their civil rights.

Attorneys from the groups Muslim Advocates and the Center for Constitutional Rights filed a notice of appeal on Friday in federal court in Newark, challenging the dismissal of a 2012 lawsuit brought by Muslim individuals and organisations who said the NYPD programs constituted unconstitutional surveillance based on religion, national origin and race. The suit had accused the department of spying on ordinary people at mosques, restaurants and schools in New Jersey since 2002.

US district judge William Martini, in dismissing the suit last month, said the NYPD's activities were part of a lawful effort to prevent terrorism. Martini said he was not persuaded that the plaintiffs were targeted solely because of their religion, writing that “the police could not have monitored New Jersey for Muslim terrorist activities without monitoring the Muslim community itself”.

Martini also said Muslims had filed suit in reaction to a series of stories by the Associated Press that revealed the NYPD's secret activities.

Attorneys for the plaintiffs said Martini's ruling could green-light discrimination by law enforcement.

“The district court's ruling gives legal sanction to targeted, religious discrimination by law enforcement without limitation,” Baher Azmy, the legal director of the Center for Constitutional Rights, said in a statement. “The decision suggests that 9/11 justifies an exemption for Muslims in our Constitution. That ruling cannot stand.”

Glenn Katon, the legal director of Muslim Advocates, a California-based civil rights organisation, likened the case to other historic civil rights cases that required appeals of lower court rulings in order to “address systemic discrimination”.

“These brave American Muslims are determined and ready to stand up for their rights and every American's right to equal treatment, regardless of faith,” Katon said in a statement.

A message left for the attorney for the city of New York, which represents the NYPD, was not immediately returned.

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