The Federal Bureau of Investigation was justified in withholding from public disclosure documents pertaining to post-9/11 use of ethnic and racial data to assess criminal and terrorist threats, a federal appeals court says.

Affirming a ruling by a federal judge in Newark, the U.S. Court of Appeals for the Third Circuit held Wednesday that the FBI had shown it was entitled to a law-enforcement exemption from the Freedom of Information Act.

The American Civil Liberties Union of New Jersey made a FOIA request for documents related to the use of race and ethnicity to conduct investigations in local communities in New Jersey. It sought information gleaned by use of the FBI’s Domestic Investigation and Operations Guide, which allows agents to collect, analyze and map racial and ethnic data.

The ACLU-NJ claims the FBI conducts mapping of minority communities under the pretext of policing national security. The presence in New Jersey of the violent Salvadoran gang MS-13 has been the stated justification for broad investigations of Central Americans and other Hispanic communities.

The FBI identified 782 pages of potentially responsive records but held back 284 pages as exempt from disclosure. The ACLU-NJ sued the FBI and the Department of Justice seeking release of the pages withheld.

U.S. District Judge Esther Salas in Newark dismissed the suit in October 2012, finding, based on in camera review, that the FBI adequately explained its reasons for withholding the pages.

On appeal, in American Civil Liberties Union of New Jersey v. Federal Bureau of Investigation, the Third Circuit rejected the ACLU-NJ’s claim that an FBI declaration describing every piece of information withheld and listing the reason it was exempt from disclosure under FOIA lacked reasonable specificity.

The declaration explained that revealing ethnic and demographic data in each withheld document would interfere with law enforcement by revealing the targets of the FBI’s investigative efforts, the court said. Once these targets were alerted that they were under investigation, they would likely change their behavior to avoid detection or further investigation, the appeals court said.

“It is hard to imagine how the FBI could provide a more detailed justification for withholding information under this exemption without compromising the very information it sought to protect,” the appeals court said.

The ACLU-NJ claimed the FBI’s assertion that investigations would be harmed by disclosure of the documents was contradicted by its release of similar information about ethnic groups in other parts of the country. The group cited information obtained about Middle Eastern and Muslim groups in Michigan and Russian and Chinese populations in San Francisco.

But Circuit Judges D. Brooks Smith, Dolores Sloviter and Jane Roth said that “common sense itself suggests that different data related to different ethnic populations in different cities used in completely different FBI investigations can vary greatly in sensitivity.”

The appeals court further disagreed with the ACLU-NJ’s assertion that releasing the “limited public source information” it seeks cannot be expected to tip off targets or permit them to circumvent investigations.

The ACLU-NJ said the demographic data is public information to begin with, but “this argument misses the obvious point that while the demographic data may be public, its use by the FBI is certainly not,” Smith wrote for the panel.

The harm in exposure lies in “revealing, indirectly, the FBI’s targeting preferences and investigative techniques, not in revealing demographic information that is already available to the public,” he said.

The ACLU-NJ sought to require the government to issue a public affidavit explaining in detail its reasons for withholding documents. But the appeals court found no legal authority compelling such a procedure and said the in camera review adopted by Salas was explicitly contemplated in the FOIA.

Nustrat Choudhury, staff attorney for the ACLU National Security Project, said in a statement, “We are deeply disappointed by this decision, which denies the public’s right to know which New Jersey communities the FBI is spying on through its secretive racial mapping intelligence program.

“Today’s decision also has far-reaching negative consequences because the court has permitted district courts to use a secret and one-sided process to adjudicate potential FBI abuses of its authority to keep information from the public,” said Choudhury, whose co-counsel was ACLU-NJ staff attorney Hina Shamsi.

The government was represented by Catherine Dorsey of the U.S. Department of Justice in Washington, D.C. A spokeswoman, Allison Price, says the department declines to comment.