Following revelations about widespread spying, the New York City Council demanded answers Thursday from Police Commissioner Raymond Kelly, who defended the department he has transformed since the Sept. 11, 2001, terrorist attacks. He said police only follow leads and do not single out groups based on religion.

“The value we place on privacy rights and other constitutional protections is part of what motivates the work of counterterrorism,” he said. “It would be counterproductive in the extreme if we violated those freedoms in the course of our work to defend New York.”

The NYPD’s intelligence division first turned its attention to colleges after receiving sketchy information that a student wanted to be a “martyr,” according to a law enforcement official familiar with the program who spoke on condition of anonymity because he was not authorized to discuss the program. But police never found this person and did not bring cases charging Muslim student groups with training terrorists, the official said.

In their surveillance, undercover officers from the department’s Special Services Unit attended events organized by Muslim students, the official said, as did members of the NYPD’s Demographics Unit, a secret squad that used plainclothes officers of Arab descent to monitor neighborhoods and events.

The NYPD’s Cyber Intelligence Unit used speakers of Arabic, Persian and other languages to monitor the websites of Muslim student organizations. They trolled chat rooms and talked to students online, the official said.

By 2006, police had identified 31 Muslim student associations and labeled seven of them “MSAs of concern,” the documents show.

Six were at branches of the City University of New York: Brooklyn College, Baruch College, City College, Hunter College, La Guardia Community College and Queens College. The other was at St. John’s University, a Catholic college in the borough of Queens.

Members of the Brooklyn College Islamic Society said their association is typical of the groups.

The club occupies two prayer rooms, one for men and one for women, off a student lounge on the western edge of campus. The American Medical Students Association is next door; the Veteran Students Organization is at the end of the lounge.

On a recent afternoon, society members made their way past students playing board games in the lounge. Hip-hop music by Flo Rida and T-Pain blared from the office of another student club.

The Muslim students entered the prayer room for men, knelt on a patch of carpet and recited quietly, occasionally touching their heads to the floor in unison.

A bumper sticker on the door of the women’s room read: “Discover Jesus in the Quran.” A table held tracts with titles like “Women’s Dress in Islam” and “Samples from the Illustrious Qur’an.” A bulletin board offered free Arabic classes.

Nazim Hussain, 21, a senior accounting major, said the club offers a quiet place to worship on the busy campus, as well as a social outlet.

“It’s just a brotherhood, nothing extreme, nothing like that,” he said. “We just do football, basketball, stuff like that.”

The documents show police were interested in guest speakers and any signs of Salafism, a strain of fundamentalist Islam.

The groups at Baruch and Brooklyn College’s featured “regular Salafi speakers” and the one at City College had a “Salafi website,” the documents said.

“Students are politically active and are radicalizing,” agents said of the Baruch Muslim Student Association. The group declined to make immediate comment.