The New York Police Department says Newark, N.J., police officials knew exactly what it was doing in their city during a 2007 intelligence-gathering operation.

The NYPD's operation catalogued and photographed every mosque in Newark. Police eavesdropped inside Muslim businesses and listed them in files.

Newark Mayor Cory Booker has called the operation "deeply offensive" and said his police never knew such broad canvassing was going on.

NYPD spokesman Paul Browne said Thursday the NYPD told Newark police about the operation before it began and briefed them afterward. Browne made the remarks during a briefing with reporters at police headquarters in Manhattan.

The NYPD says the operation was legal, citing Supreme Court rulings and a court order governing the gathering of intelligence.

(Copyright 2012 by The Associated Press.  All Rights Reserved.)