The city and the Police Department have come under intense scrutiny over the surveillance tactics, in which for more than a year before the convention undercover officers traveled to cities across the country, and to Canada and Europe, to conduct covert observations of people who planned to attend. But beyond potential troublemakers, those placed under surveillance included street theater companies, church groups, antiwar activists, environmentalists, and people opposed to the death penalty, globalization and other government policies.

And as the convention unfolded, more than 1,800 people were arrested, mostly for minor violations, and many were herded into pens at a Hudson River pier and fingerprinted instead of being released on summonses or desk appearance tickets, which are more customary for charges that amount to little more than a traffic ticket.

As scores of federal lawsuits challenging the mass arrests on Aug. 31, 2004, were filed in Federal District Court in Manhattan, with plaintiffs claiming wrongful detentions of up to two days and other violations by the police to keep protesters off the streets, the outlines of the extensive covert surveillance operation began to emerge from court records.

In March, The New York Times disclosed details of the sweeping operation, including a sample of raw intelligence documents and summaries of observations from field agents and the police cyberintelligence unit. Some plaintiffs and their lawyers, seeking to bolster their cases, asked the court to disclose the documents. In May, Judge Francis allowed the disclosure of 600 pages of documents relating to security preparations before the convention.

But a second batch of documents, including pictures and reports by undercover agents detailing which protest groups were infiltrated and the results of the surveillance operations, remained in contention. The city argued that disclosure would reveal sources, methods and other information that might compromise current and future investigations, while the plaintiffs contended that the reports would disprove city claims that the protesters planned to engage in violence, and would show that mass arrests had been unnecessary.

In his ruling yesterday, Judge Francis acknowledged that some information in the documents needed to be protected. He himself edited out what he regarded as privileged law enforcement information in many “field intelligence reports” from agents covering confidential sources and techniques. And he did not order the release of documents in which the Republican convention was not mentioned.

But he rebuffed city arguments that general information gathered about an organization would necessarily jeopardize confidential police matters. “It is difficult to imagine how someone could determine the identity of an undercover officer simply from the fact that he or she was present at a meeting or protest attended by dozens, if not hundreds, of people,” the judge declared.