A panel of federal judges ruled Wednesday that New York City can keep secret about 1,800 pages of records detailing the Police Department’s surveillance and tactical strategy in advance of protests at the 2004 Republican National Convention.

In reversing a lower court decision, the three-judge panel of the United States Court of Appeals for the Second Circuit sided with the department’s position that releasing the documents could compromise future surveillance efforts, including those centered on terrorism suspects.

Releasing the documents “could undermine the safety of law enforcement personnel and would likely undermine the ability of a law enforcement agency to conduct future investigations,” according to the 43-page decision, written by Judge José A. Cabranes, whom President Bill Clinton appointed. He was joined in the ruling by Judges Debra A. Livingston and Richard C. Wesley, both appointees of President George W. Bush.

The ruling appears to end a battle over the documents that lasted more than three years and comes amid a case that represents the largest legal challenge to the powers extended to the police since the Sept. 11 attack. Initially, the issue was full disclosure of evidence amid depositions in federal lawsuits brought by the New York Civil Liberties Union against the city.