“We’re proud of our relationship with C.I.A. and its training,” he said, saying it was partly responsible for the absence of casualties from a terror attack in New York in the years since Sept. 11 and the anthrax attacks. He added that the terrorists “keep coming and we keep pushing back.”

The C.I.A.-Police Department partnership dates from 2002, when David Cohen, a former C.I.A. officer who became deputy commissioner for intelligence at the Police Department after the Sept. 11 attacks, reached out to his former agency in building up its counterterrorism abilities.

The inspector general’s office began the investigation in August 2011 after The Associated Press published an article about the C.I.A.’s relationship with the Police Department’s intelligence division. It was part of a series about New York police surveillance of Muslims that was later awarded a Pulitzer Prize for investigative reporting.

When the classified report was completed in 2011, spokesmen for the C.I.A. and the Police Department said it had concluded that the C.I.A. had not violated a law and an executive order that prohibited it from domestic spying or performance of law-enforcement powers. But the document shows that that conclusion was not the whole story. The inspector general warned in his cover letter that the collaboration raised “considerable and multifaceted” risks for the agency.

This week, it released an executive summary and cover memo in response to a Freedom of Information Act lawsuit filed by the Electronic Privacy Information Center, a nonprofit civil-liberties group, which provided it to The New York Times.

“The C.I.A. is not permitted to engage in domestic surveillance,” said Ginger McCall, the director of the group’s Open Government Project. “Despite the assurances of the C.I.A.’s press office, the activities documented in this report cross the line and highlight the need for more oversight.”

Dean Boyd, a C.I.A. spokesman, said the inspector general found no legal violations or evidence that the agency’s support to the Police Department constituted “domestic spying.”