Updated

The National Security Agency was rebuked by a secret court in 2011 for collecting thousands of emails and other online details from Americans with no ties to terrorism, according to court opinions which were declassified for the first time on Wednesday.

The Office of the Director of National Intelligence took the unusual step of declassifying more than 100 pages of documents, amid the escalating public debate about government surveillance programs. The release comes several days after a report showed that the NSA had violated privacy rules and overstepped its authority thousands of times.

Some of those incidents were minor, but the documents released Wednesday detail major compliance problems.

In 2011, the Foreign Intelligence Surveillance Court was notified of a problem involving "upstream collection," which is the collection of Internet traffic outside of the service providers. The NSA was collecting bundled email communications under a provision which focuses on foreign Internet traffic. The NSA, though, was not effectively segregating all the traffic from Americans.

The court rebuked the NSA for the violation.

More On This...

    "For the first time 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," John D. Bates, a judge on the surveillance court, said in October 2011.

    The NSA reported the problems it discovered in how it was gathering Internet communications to the court and shortly thereafter to Congress in the fall of 2011.

    Three senior U.S. intelligence officials said Wednesday that the NSA realized that when it was gathering up bundled Internet communications from fiber optic cables, with the cooperation of telecommunications providers like AT&T, it was often collecting thousands of emails or other Internet transactions by Americans who had no connection to the intended terror target being tracked.

    The documents show the NSA scooped up as many as 56,000 emails and other communications by Americans with no connection to terrorism annually over three years.

    While the NSA is allowed to keep the metadata -- the address or phone number and the duration, but not the content, of the communication -- of Americans for up to five years, the court ruled that when it gathered up such large packets of information, they included actual emails between American citizens, and it violated the Constitution's ban against unauthorized search and seizure.

    For instance, two senior intelligence officials said, when an American logged into an email server and looked at the emails in his or her inbox, that screen shot of the emails could be collected, together with Internet transactions by a terrorist suspect being targeted by the NSA -- because that suspect's communications were being sent on the same fiber optic cable by the same Internet provider, in a bundled packet of data.

    The NSA then worked with Congress and the court to correct the problem but ultimately decided it could not salvage the data it collected. It was purged in 2012.

    Fox News reviewed the documents along with several other news agencies before their release on Wednesday. Based on the documents, at least 75 million Internet communications were purged.

    The NSA claims the problem was technical in nature because the pulling of Internet traffic is automated.

    The NSA disclosed that it gathers some 250 million Internet communications each year, with some 9 percent from these "upstream" channels, amounting to between 20 million to 25 million emails a year.

    Under court order, the NSA resolved the problem by creating new ways to detect when emails by people within the U.S. were being intercepted, and separated those batches of communications. It also developed new ways to limit how that data could be accessed or used. The agency also agreed to only keep these bundled communications for possible later analysis for a two-year period, instead of the usual five-year retention period.

    The newly released court opinions revealed the court signed off on the new procedures, deeming them constitutionally acceptable.

    The Wall Street Journal, meanwhile, reported on Wednesday that NSA surveillance programs have the potential to reach 75 percent of U.S. Internet traffic.

    The agency maintains it is protecting privacy rights.

    The latest documents were released in response to President Obama's directive for the NSA to be more transparent, according to senior intelligence officials. It also seemed designed to answer growing criticism that the NSA oversight is inadequate by the surveillance court, and its own internal reporting systems are lacking.

    Fox News' Catherine Herridge and the Associated Press contributed to this report.