WASHINGTON -- A federal judge sharply rebuked the National Security Agency in 2011 for gathering and storing tens of thousands of Americans' emails each year as it hunted for terrorists and other legitimate foreign targets, according to the top-secret court ruling, which was made public Wednesday.
The 85-page ruling by Judge John D. Bates, then serving on the Foreign Intelligence Surveillance Court, involved an NSA program that searches Americans' international Internet communications for discussion of foreigners under surveillance. Judge Bates found that the agency had violated the Constitution for several years, and declared the problems part of a pattern of "misrepresentation" by agency officials in submissions to the secret court.
The release of the ruling, under pressure from a Freedom of Information Act lawsuit, was the latest effort by the Obama administration to contain revelations about NSA surveillance prompted by leaks by former agency contractor Edward J. Snowden.
The documents showed that the problems, which the agency brought to the court's attention after they had gone on for several years, were relatively small compared with the scale of NSA surveillance. The ruling estimated that the agency intercepts more than 250 million communications each year from the United States as it targets foreign citizens abroad. And the NSA fixed the problems to the court's satisfaction, the documents showed.
But the documents also revealed further problems. Judge Bates portrayed the issue as only the latest time the agency had misled the oversight court about its domestic spying activities. "The court is troubled that the government's revelations regarding NSA's acquisition of Internet transactions mark the third instance in less than three years in which the government has disclosed a substantial misrepresentation regarding the scope of a major collection program," he wrote.
One of the examples he cited was redacted in the ruling. Another involved a separate NSA program that keeps logs of all domestic phone calls, which the court approved in 2006, and which came to light in June as a result of leaks by Mr. Snowden.
In March 2009, a footnote said, the surveillance court learned that NSA analysts were using the phone log database in ways that went beyond what the judges believed to be the practice because of "repeated inaccurate statements" in government filings to the court.
The Electronic Frontier Foundation, a free speech and privacy rights group, sued to obtain the ruling after Senate Intelligence Committee member Ron Wyden, D-Ore., fought last summer to declassify information that the surveillance court had ruled that the NSA had violated the Fourth Amendment. In a statement, Mr. Wyden, an outspoken NSA surveillance critic, said the ruling's declassification was "long overdue." He argued that while the NSA had increased privacy protections for purely domestic and unrelated communications that were swept up in the surveillance, the collection itself "was a serious violation of the Fourth Amendment."
The Electronic Frontier Foundation's Mark Rumold praised the administration for releasing the document with relatively few redactions, although he criticized the time and difficulty in obtaining it. But he also said the ruling showed that the surveillance court was not equipped to perform adequate oversight of the NSA.
"This opinion illustrates that the way the court is structured now it cannot serve as an effective check on the NSA, because it's wholly dependent on the representations that the NSA makes to it," he said. "It has no ability to investigate. And it's clear that the NSA representations have not been entirely candid to the court."
A senior intelligence official, speaking to reporters in a background conference call, portrayed the ruling as showing that NSA oversight was robust and serious. He said some 300 NSA employees were assigned to seek out even inadvertent rules violations, and that the court conducted "vigorous" oversight.
The ruling focused on a program under which the NSA has been searching domestic Internet links for communications -- where at least one side is overseas -- in which there are "strong selectors" indicating insider knowledge of someone who has been targeted for foreign-intelligence collection. One example would be mentioning a person's private email address in the body of an email.
A Justice Department "white paper" released with the ruling shed new light on NSA surveillance of communications streaming across domestic telecommunications networks. Such "upstream" collection, which still must be targeted at or be about noncitizens abroad, accounts for about 10 percent of all the Internet messages collected in the United States, it said; the other 90 percent are obtained from Internet firms under the system the NSA calls Prism.
The administration also released a partly redacted semiannual report about "compliance" incidents, or mistakes involving the privacy rights of Americans or people in the United States. It found that there had been no willful rules violations, and that fewer than 1 percent of queries by analysts involved errors.
The document also showed that the government recently changed the rules to allow NSA and CIA analysts to search its databases of recorded calls and emails using search terms designed to find information involving U.S. citizens, not foreigners -- an issue that has long concerned Mr. Wyden, and that was mentioned in a document leaked by Mr. Snowden and published by Britain's The Guardian.
The number of "selectors" designed to filter out and store communications targeted at foreigners had gone up steadily, the document said, although the numbers were redacted. And its increase is expected to "accelerate" because the FBI recently made the ability to nominate people for such collection "more widely available to its field office personnel."