The secretive court that oversees surveillance programs found in 2011 that the National Security Agency illegally collected tens of thousands of emails between Americans in violation of the fourth amendment to the US constitution.

The foreign intelligence surveillance (Fisa) court ruling stemmed from what intelligence officials told reporters on Wednesday was a complex technical problem, not an intentional violation of American civil liberties.

In his 86-page opinion, declassified on Wednesday, Judge John Bates wrote that the government informed 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".

The ruling is one of three documents released in response to a Freedom of Information Act request by the Electronic Frontier Foundation, and comes amid growing public and congressional concern over the scope of NSA surveillance programs.

An intelligence official who would not be identified publicly described the problem to reporters during a conference call on Wednesday.

"If you have a webmail email account, like Gmail or Hotmail, you know that if you open up your email program, you will get a screenshot of some number of emails that are sitting in your inbox, the official said.

"Those are all transmitted across the internet as one communication. For technological reasons, the NSA was not capable of breaking those down, and still is not capable, of breaking those down into their individual [email] components."

If one of those emails contained a reference to a foreign person believed to be outside the US – in the subject line, the sender or the recipient, for instance – then the NSA would collect the entire screenshot "that's popping up on your screen at the time," the official continued.

"On occasion, some of those [emails] might prove to be wholly domestic," the official said. If a foreign person being targeted is in contact with an American, "you can get all that US person's screenshot" from his or her inbox.

The Fisa court estimated, based on models provided by the NSA, that the surveillance agency was collecting up to 56,000 purely domestic communications a year in the three years before the court ruling, as the Washington Post first reported.

Somewhere between "2,000-10,000" of those involved multiple communications acquired in single collections, such as the e-mail inbox screenshots. Approximately 46,000 involved collections of single emails or other internet communications.

"NSA has acquired, is acquiring, and if the certifications and procedures now before the Court is approved, will continue to acquire, tens of thousands of wholly domestic communications," Bates wrote in his ruling.

The exact total remained a mystery to the court. "The actual number of wholly domestic communications acquired may still be higher," Bates wrote.

The Court had more precise visibility into the NSA's total internet acquisitions annually. NSA consumed 250 million internet communications each year, according to an assessment by Bates in 2011. Some 9% of that was collected as the communications transit across the internet, a process known as "upstream" collection. The remaining 91% comes to NSA from its internet service provider partners.

It was the NSA's handling of data collected upstream that the Fisa court found to be constitutionally problematic.

Wholly domestic communications are banned from the NSA's collection under section 702 of the 2008 Fisa Amendments Act. An NSA document leaked by whistleblower Edward Snowden and published by the Guardian on August 9 referred to an October 2011 change in the rules, by which the NSA must purge data it improperly collected but that said the NSA could still search its so-called "702" databases for "certain US person names and identifiers," though not until an "effective oversight process" was implemented.

Senator Ron Wyden, a member of the intelligence committee, refers to the NSA's still-current authorities to query those databases for US person information as a "backdoor search" loophole.

Intelligence officials on Wednesday's conference call said that the Fisa court paused the program but found that it was "technologically impossible to prevent this from happening". The court found the NSA's procedures for purging wholly domestic communications "needed to be beefed up, and that's what was done," an official said.

Intelligence officials released the post-2011 so-called "minimization" procedures they developed after the court paused the program. They included "post-acquisition technical means to segregate transactions that were most likely to contain US person information." Those that couldn't be were subjected to other restrictions that "significantly limited the government's ability to use or disseminate" information about Americans.

The officials also said the NSA can now retain upstream data for only two years rather than five.

But the interception of email mailbox "screenshots" that can contain wholly domestic communications apparently continues.

The declassified ruling gives a glimpse of the court's apparent frustration over the accuracy of information it was given about NSA programs.

In a footnote, Bates wrote that the court was "troubled that the government's revelations regarding the NSA's acquisitions 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".

In 2009, Bates wrote, the court found that its approval of a government interpretation of section 215 of the Patriot Act to justify the bulk collection of all Americans' phone records – a different authority than section 702 of the Fisa Amendments Act – was substantially flawed.

That approval was "premised on a flawed depiction" of how the program operated, Bates wrote, "buttressed by repeated inaccurate statements in the government's submissions" to the court.

The court concluded in 2009, Bates said, that the standards the government used to search the phone records databases for threats to national security were "so frequently and systemically violated that it can be fairly said that this critical element of the overall … regime has never functioned effectively".

Wyden said the disclosed Fisa Court ruling – which he first revealed existed last year – pointed to the need to close the "backdoor search" loophole.

"The ruling states that the NSA has knowingly acquired tens of thousands of wholly domestic communications under section 702 of the Foreign Intelligence Surveillance Act, even though this law was specifically written to prohibit the warrantless acquisition of wholly domestic communications," Wyden said.

"The FISA Court has noted that this collection violates the spirit of the law, but the government has failed to address this concern in the two years since this ruling was issued. This ruling makes it clear that FISA Section 702, as written, is insufficient to adequately protect the civil liberties and privacy rights of law-abiding Americans and should be reformed."

Mark Udall, another critic of the NSA's bulk collection efforts who sits on the intelligence committee, said: "I am glad the NSA is taking this step at owning its mistakes, but it is also a sign that we can and must do more to protect innocent Americans with no connection to terrorism from being monitored by our government — whether intentionally or not. I will keep fighting to ensure that the NSA is not violating Americans' privacy rights."

In the nearly three months since the Guardian began reporting on NSA surveillance programs, US intelligence officials have frequently said their violations of laws and rules involving American data are simply technical problems – something Wyden and Udall criticized as misleading in late July.

Bates' 2011 opinion criticized the NSA for a similar swearing to the court. "There is nothing in the record to suggest that NSA's technical means are malfunctioning or otherwise failing to operate as designed," he wrote.

The current Fisa court presiding judge, Reggie Walton, told the Washington Post last week that the Fisa court remains reliant on government assurances, rather than its own independent oversight capabilities, to determine that the NSA and the government is in compliance with surveillance law and agreed-upon procedures.

In a covering letter published alongside the documents, the director of national intelligence James Clapper said the decision to declassify, which followed Barack Obama's order for the intelligence community to be more transparent, was "not done lightly" but the "harm to national security is outweighed by the public interest".