/ Updated 
By Chris Fuchs

A New York State appeals court unanimously ruled Thursday that the New York Police Department (NYPD) does not need to disclose records relating to investigations or surveillance of a Harlem imam and a Rutgers University student.

Talib W. Abdur-Rashid, the imam, and Samir Hashmi, the student, had made their requests in 2012 under the Freedom of Information Law (FOIL). The NYPD, however, invoked what is known as the Glomar response, a rule that allows agencies to neither confirm nor deny the existence of records if doing so would harm law enforcement efforts.

Muslim community members and supporters march near 1 Police Plaza to protest the New York Police Department surveillance operations of Muslim communities on Nov. 18, 2011, in New York.Bebeto Matthews / AP file

Conflicting lower-court rulings in lawsuits that the two men later filed sent the case to the State Supreme Court Appellate Division in Manhattan, which said FOIL does not prohibit the NYPD from giving a response that refuses “to confirm or deny the existence of records.”

“The affidavits submitted by NYPD’s Chief of Intelligence establish that confirming or denying the existence of the records would reveal whether petitioners or certain locations or organizations were the targets of surveillance, and would jeopardize NYPD investigations and counterterrorism efforts,” the court wrote.

RELATED: New York City Settles Lawsuits Concerning Muslim Surveillance, Will Institute Reforms

In a statement, New York City Law Department spokesman Nick Paolucci told NBC News, “We are all safer because of this ruling, which confirms that the NYPD is not required to reveal the targets of counterterrorism surveillance."

Omar T. Mohammedi, who represents Abdur-Rashid and Hashmi, said he plans to appeal.

“The ruling today is a sad day for an Open Government theory under the Freedom of Information Law requirements,” Mohammedi told NBC News in a statement.

The appeals court noted in its ruling that federal circuit courts have widely approved the application of Glomar to Freedom of Information Act requests. But the court added that a Glomar response is not necessarily justified in every FOIL request for NYPD records, though in this case it was appropriate.

“An agency resisting disclosure of the requested records has the burden of proving the applicability of [a FOIL] exemption,” the appellate judges wrote.

The appeals court decision comes five months after New York City agreed to settle a pair of lawsuits stemming from alleged surveillance of Muslims. That agreement brings a number of reforms to the NYPD, including the banning of investigations motivated by race, religion, or ethnicity.

In 2014, the NYPD disbanded a unit formed in the wake of the Sept. 11, 2001, terrorist attacks that allegedly spied on Muslims, a decision that at the time drew praise from New York City Mayor Bill de Blasio.

Follow NBC Asian America on Facebook, Twitter, Instagram, and Tumblr.