After a seven-year delay, the court ruled that the NSA’s mass surveillance program was illegal.

A federal appeals court ruled Wednesday that the National Security Agency’s (NSA) plan to collect billions of calls and text messages from Americans is illegal and potentially unconstitutional,media reported. However, a three-judge panel of the 9th Circuit Court of Appeals unanimously said the so-called phone metadata program played such a small role in the terrorist fundraising case against four Somali immigrants that it did not undermine their convictions.

The long-awaited verdict was a victory for prosecutors, but some of the language in the court’s opinion could be seen as some kind of rebuke to officials who, by pointing to cases involving Basaaly Moalin and three other men, were found guilty by a San Diego jury in 2013 of raising money for al-Shabab.

Judge Marsha Berzon’s opinion included references to the role of Edward Snowden, a former NSA contractor and whistleblower, in disclosing the NSA metadata program, concluding that the “massive collection” of the data violated the Foreign Intelligence Surveillance Act (FISA).

After a seven-year delay, the court ruled that the NSA's mass surveillance program was illegal.

After 9/11 in 2001, under former U.S. President George W. Bush, call tracking began without court authorization. Since 2006, a similar program has been approved by a secret FISA court and updated several times, but the 9th Circuit panel says the rulings are legally flawed.

The appeals court simply ruled that the surveillance program was absolutely unconstitutional, but rejected the Justice Department’s argument that collecting metadata does not amount to a search, based on legal precedent 40 years ago, because customers voluntarily share the information with phone providers.

“Here, the NSA collects phone metadata from Moalin (and millions of other Americans) that has been collected daily for years,” Berzon wrote. “Moalin probably has reasonable privacy expectations for his phone metadata — at least, it’s a close issue.”

Berzon’s opinion was co-sponsored by Judge Jacqueline Nguyen, appointed by former President Barack Obama, and Judge Jack Zouhary, appointed by George W. Bush.

The 9th Circuit Court of Appeals panel largely upheld a 2015 ruling by the New York-based 2nd Circuit that said mass surveillance was not linked enough to any specific investigation, as Congress seemed to demand. Berzon said the defendants had the right to note that surveillance related to foreign intelligence contributed to the case, but not necessarily specific details. But she said that even if Moalin and his co-defendants had a clear notice, they would not have helped their defense.

“Based on our careful review of confidential records, we are satisfied that any lack of notice, assuming that such notice is required, does not harm the defendant’s interests,” she wrote. “After careful review of confidential FISA applications and all relevant confidential information, we are satisfied that metadata collection, even if unconstitutional, does not affect the evidence presented by the government at trial, in accordance with established Fourth Amendment standards.”

In the public debate over the plan — six or seven places, as noted in the opinion, were triggered by Snowden’s disclosure — many officials pointed to moalin’s indictment as concrete evidence that the plan would help the United States prosecute terrorism. Other examples cited by officials are mainly overseas. The Moalin case is not about any planned attacks in the United States, but about Somalia.

The new 9th Circuit Court of Appeals, citing congressional testimony from former FBI official Sean Joyce, said the metadata program gave agents a breakthrough that led them to reopen their investigation into Moalin. But Berzon went on to say that Joyce or others’ public statements were inaccurate because metadata items did not play a key role.

“In terms of the contrary impression caused by public statements by government officials, this impression is inconsistent with the content of confidential records,” she wrote. “

Joyce, who retired from the FBI a few years ago, did not immediately return messages seeking comment.

The metadata program was officially shut down in 2015 after Congress passed the USA Freedom Act, which provided a new mechanism for mobile phone providers to keep their data rather than hand it over to the government. The modified system appears to have been abandoned by the NSA in 2018 or 2019.

The 59-page opinion, released Wednesday, is another reminder that some 9th Circuit court appeals have been extremely slow, especially those involving classified information or FISA surveillance. It took nearly seven years for the court to render a legal decision on Moalin’s appeal in November 2013. The case was debated in November 2016, two days after Trump’s surprise victory in the presidential election.

Moalin, who was sentenced to 18 years in prison, and one of his co-defendants remain in prison. Two other co-defendants have been released from prison.

And the case may not be over yet. Any defendant or Government may apply to the larger 11-judge d’a panel for review. A Supreme Court petition is also possible.

“We are disappointed by this result, especially the recent additional disclosures about FISA misconduct, which further reveal how the lack of transparency throughout the process undermines the personal rights of those accused of crimes, as well as those who have never been charged — including Americans who have phone metadata collected and retained,” Moalin’s attorney, Joshua L. Dratel, said. “In this case, we believe that the lack of transparency undermines our ability to challenge FISA surveillance.”

The American Civil Liberties Union (ACLU) hailed the ruling as a “victory for our right to privacy,” but the leftist group said it was “disappointing that the court refused to order the suppression of evidence illegally obtained in Mr. Moalin’s case after finding that his surveillance was unlawful.” The ACLU said Moalin’s defense team is now “evaluating options for further appeal.”

A spokesman for the U.S. Department of Justice did not immediately comment on the ruling. A spokesman for the National Security Agency declined to comment.

Another recent 9th Circuit Court of Appeals ruling on allegations of illegal surveillance took about six years to produce an opinion, also written by Berzon. The Justice Department said in a court filing Tuesday that it is still considering whether to seek a Supreme Court review of the case.