After the Associated Press revealed that the NYPD was conducting surveillance of Muslims on the basis of their religion, legal scholars immediately began to debate whether the NYPD's program was a violation of the First Amendment. Now, the issue is set to be heard in a federal courtroom in New Jersey.

A group of New Jersey residents, mosques, and organizations on Wednesday filed a federal lawsuit against the City of New York, accusing the NYPD of violating their constitutional rights by targeting them for surveillance outside of mosques, in Muslim student group meetings, and at religious schools on the basis of their religion. The lawsuit could help define how far investigators can go in the name of national security.

“The facts are just so compelling, what the NYPD is doing is egregious. It may be going on in other law enforcement agencies, but the AP reports are a smoking gun that they are targeting people based on religion,” says Glenn Katon, legal director of Muslim Advocates, a California-based nonprofit that is representing the plaintiffs.

So far, the NYPD's tactics have included sending an officer on a student whitewater rafting trip to note how frequently participants stopped for prayer, taking down the license plate numbers of cars parked at mosques, and noting patrons and employees in shops catering to observant Muslims.

Police Commissioner Ray Kelly has said that police need to do this type of work in a post-9/11 world. In a statement, NYPD Deputy Commissioner Paul Browne referred to New Jersey Attorney General Jeffrey Chiesa’s determination that the surveillance efforts were legal. Mr. Browne added that “NYPD activities in New Jersey were lawful, appropriate, and in keeping with efforts there, in New York, and around the world to prevent terrorists from returning here to kill more New Yorkers.”

The plaintiffs, who are suing to end the surveillance and to expunge the police files, think a jury will disagree. They say that the police have deterred their free exercise of religious belief and hurt Muslim businesses.

Those suing the City of New York include Syed Farhaj Hassan, a decorated veteran from the war in Iraq. Mr. Hassan says the surveillance has deterred him from attending religious services because he does not want his military intelligence career harmed by an association with mosques being monitored.

Among other plaintiffs are a college student who says she doesn’t feel free discussing matters of religion at Muslim student meetings for fear that she may be watched by undercover cops, and businesses who say they’ve lost customers after the revelation that they were under surveillance.

“We thought that these things were left behind during the McCarthy era, targeting people based on race and religion alone, vilifying an entire community,” says Abed Ayoub, legal director of the American-Arab Anti-Discrimination Committee. “We need some accountability. If we allow the NYPD to do this we are throwing our right to privacy away.”

Though this is the first lawsuit to challenge the NYPD tactics, Mr. Ayoub thinks it won’t be the last. “This is probably only the beginning of the challenges that are going to come forward, both on the legal and the policy level.”

For a jury to determine that the surveillance tactics are illegal, the plaintiffs will have to show that the police program impermissibly harmed the free exercise of religion.

Mr. Katon says that some people defend the surveillance by saying that it only happens in public places.

But, he says, “Anything that targets people based on religion or race poses a serious problem in our society. If you said we’re only going to watch Catholics; or we’re only going to watch Kosher delis but not German or Italian delis, that should offend everybody.”