A federal judge has ruled that the New York Police Department illegally arrested large numbers of demonstrators at a protest in Lower Manhattan during the 2004 Republican National Convention. But the judge upheld aspects of how the city had handled the protesters’ arrests.

The judge, Richard J. Sullivan of Federal District Court, said that the city had lacked the required probable cause because the police were unaware of whether each individual protester had broken the law.

“An individual’s participation in a lawbreaking group may, in appropriate circumstances, be strong circumstantial evidence of that individual’s own illegal conduct,” the judge wrote in a 32-page opinion. “But, no matter the circumstances,” he added, “an arresting officer must believe that every individual arrested personally violated the law. Nothing short of such a finding can justify arrest. The Fourth Amendment does not recognize guilt by association.”

The ruling on the protest, which occurred on Fulton Street on Aug. 31, 2004, was a kind of test case examined by the judge of one group of plaintiffs among hundreds who filed false-arrest claims in the wake of the demonstrations, which rippled across the city during the convention and at times erupted into confrontations with the police. The ruling, dated Sunday, opens the door for the city to have to pay damages to the plaintiffs in the Fulton Street arrests. More than 200 were arrested during that protest, though not all have lawsuits pending.