CNN  — 

The US Supreme Court on Friday said the federal government could invoke the state secrets privilege to protect evidence it said could harm national security, in a case brought by three Muslim men.

The men are seeking to sue the government for hiring a confidential informant to secretly engage in electronic surveillance and gather information about their community in violation of their religious rights.

While the government invoked the state secrets privilege, a lower court said that the Foreign Intelligence Surveillance Act – a law aimed at electronic surveillance – displaced the state secrets privilege. In a 9-0 ruling, the Supreme Court disagreed.

“Although today’s ruling is technical, it’s likely to have ominous implications for the ability of those subjected to unlawful spying by government intelligence agencies to ever challenge that spying in court,” said Steve Vladeck, CNN Supreme Court analyst and professor at the University of Texas School of Law.

“Congress enacted FISA in 1978 not only to rein in abuses of government surveillance powers, but to provide effective remedies for those abuses. Today’s ruling will make it that much harder for plaintiffs to pursue those remedies in any case in which the allegedly unlawful spying involves national security secrets.”

The dispute stems from a lawsuit brought by Yassir Fazaga and two other Muslim men, who say an undercover informant for the FBI infiltrated a mosque in Orange County, California, in 2006. They claim the informant spent more than a year collecting names, phone numbers, emails and other information culled from the community as a part of a counterterrorism investigation.

According to court papers, the FBI told the informant, Craig Monteilh, that it wanted to “get as many files on this community as possible.” The informant attended classes at the mosque, gathered information related to charitable giving and attended Muslim fundraising events, all the while going to daily prayers. Most of his interactions were recorded using devices provided by the FBI.

In the end, Monteilh uncovered no terrorism. And when he began to ask about a willingness to engage in violent actions, several members of the community reported him to law enforcement. Ultimately, they learned he was an informant and sued, arguing that the government violated their religious freedom.

The District Court for the Southern District of California dismissed the claims, under the state secrets privilege, “which permits the government under some circumstances to block the release of information in a lawsuit that could harm national security.”

The 9th US Circuit Court of Appeals reversed the decision, holding that FISA provides for procedures for challenging unlawful electronic surveillance in early stages of litigation and takes priority over the states’ secret privilege.

The federal government appealed to the Supreme Court.

Ahilan Arulanantham, a lawyer for the men – two US citizens and one lawful permanent resident – told the justices at oral arguments last year that his clients should be able to have their day in court after the government violated the Constitution’s protection of freedom of religion.

Fazaga says the 9th Circuit was right to permit the case to proceed because FISA allows the review of the lawfulness of the surveillance “and at least at the threshold” displaces a claim based on state secrets.

He said that the state secrets privilege authorizes the exclusion of evidence but not the use of secret evidence to entirely dismiss a case.

Deputy Solicitor General Edwin Kneedler told the justices that the federal appeals court decision holding that FISA displaced the state secrets privilege would seriously undermine the executive branch’s ability to protect the nation’s secrets. He said the privilege is “critical in safeguarding” national security.