U.S. intelligence officials have declassified a secret court opinion that both chastises the National Security Agency for misleading the court and highlights an eavesdropping program in which authorities have direct access to "upstream" internet communications.

The document (.pdf) released today confirms for the first time unofficial leaks and speculation that the federal intelligence community has direct access to telecom companies' backbones and it scoops up email communications as they go past. Millions are collected each year. WIRED first reported on such an eavesdropping installation in 2007 when a former AT&T technician provided documents outlining eavesdropping technology used by AT&T. Both the government and AT&T have declined to confirm the authenticity of the technician's documents.

Today's startling revelation was outlined in a 2011 opinion by Judge John D. Bates, then the chief judge of the Foreign Intelligence Surveillance Court, a secret tribunal that often rubber-stamps government surveillance requests in classified rulings.

One function of the court is to ensure the NSA's activities target communications of those "reasonably believed to be located outside the United States." The surveillance must also be designed to "prevent the intentional acquisition of any communication as to which the sender and all intended recipients are known at the time of the acquisition to be located in the United States."

In the 81-page highly redacted opinion declassified today, Bates chided the government for misrepresenting the reach of the "upstream" internet surveillance program between 2008 and 2011.

Indeed, the record before this court establishes that NSA's acquisition of Internet transactions likely results in NSA acquiring annually tens of thousands of wholly domestic communications, and tens of thousands of non-target communications of persons who have little or no relationship to the target but who are protected under the Fourth Amendment.

Earlier in the opinion, Bates wrote, "the government has now advised the Court that the volume and nature of the information it has been collecting is fundamentally different from what the court had been led to believe."

Sen. Ron Wyden (D-Oregon) and Sen. Mark Udall (D-Colorado), the leading Congressional critics of the NSA and its surveillance tactics, have said of the surveillance: "We believe Americans should know that this confirmation is just the tip of a larger iceberg."

The NSA estimated it was collecting thousands of "wholly domestic" communications each year.

"This was not in any respect an intentional or wholesale breach of privacy of American persons," Robert S. Litt III, general counsel of the Office of the Director of the National Intelligence, told The Washignton Post.

Mark Rumold, a staff attorney with the Electronic Frontier Foundation – which fought to declassify the ruling – said in a telephone interview today, "the opinion basically found that the government's FISA Amendments Act surveillance that it was conducting by sitting on the wires of providers was unconstitutional."

The government has subsequently altered its collection program in a bid to sift out purely domestic traffic.

Today's revelation follows disclosures by NSA leaker Edward Snowden, who highlighted other NSA-backed spy programs, including one called PRISM and another that collects metadata from every phone call made in America.