Updated

New Jersey lawmakers are trying to require law enforcement agencies from elsewhere to give notice when they plan to conduct counterterrorism surveillance in the state, a measure prompted by revelations about New York City police spying on Muslims.

The impetus for the proposal, which passed a Senate committee Monday, came from a series of articles by The Associated Press that revealed the NYPD operated secretly in New Jersey neighborhoods where Muslims lived and worked. They spied on Muslim organizations, infiltrated Muslim student groups and videotaped mosque-goers.

The NYPD has said its operations were lawful and necessary to keep the city safe. New York City Mayor Michael Bloomberg has said the NYPD can gather intelligence anywhere in the country it wants and is not required to tell local authorities.

But the NYPD did not violate any state laws because New Jersey has none that bar outside law enforcement agencies from secretly conducting operations within its borders, a review last year by then-New Jersey Attorney General Jeffrey Chiesa found.

Lawmakers want to require out-of-state law enforcement agencies to give the appropriate county prosecutor at least 24 hours' notice that they intend to conduct surveillance. The prosecutor would then notify the state police, who would notify the state Office of Homeland Security and Preparedness.

The Senate Law and Public Safety Committee passed the bill 5-0 without discussion and sent it to the full Senate. The Assembly's version of the bill passed 76-3 in October.

If the bill becomes law, county prosecutors would have the power to seek a court injunction against an out-of-state agency that fails give notice.

In addition, any New Jersey law enforcement agents who learned of an out-of-state agency conducting counterterrorism surveillance would be required to notify the county prosecutor.

Last year, some Newark police officials told the AP that they were aware the NYPD was in the city but weren't given a full accounting of their activities there. Mayor Cory Booker said at the time that he and others were misled and called the surveillance based on religious affiliation "deeply offensive."