The US government spied on electronic communications between Americans with no links to terror suspects until a judge ruled it illegal in 2011, officials acknowledged.
The unlawful program, which involved tens of thousands of emails, was revealed in declassified documents from the Foreign Intelligence Surveillance Court, which reviews the legality of eavesdropping programs.
The court's opinions are usually kept secret but the government chose to release the documents amid a firestorm over sweeping surveillance operations, following bombshell leaks from a former US intelligence contractor, Edward Snowden.
Officials said the court rulings had been declassified to better inform the public about how the eavesdropping programs are carried out with what they called rigorous "oversight."
Under the program addressed by the court in 2011, the NSA had diverted a massive trove of international data flowing through fiber-optic cables in the United States, purportedly to sift through foreign communications.
But the NSA proved unable to separate out emails between Americans who had no links to terror suspects, and the agency was collecting tens of thousands of "wholly domestic communications" every year, the court said in documents posted by the Office of the Director of National Intelligence.
The court concluded the program violated privacy rights enshrined in the Fourth Amendment to the US Constitution.
The surveillance resulted "in the acquisition of a very large number of Fourth Amendment-protected communications that have no direct connection to any targeted facility and thus do not serve the national security needs" defined under the law, the court said.
The government altered the program and later came back to the court for approval of a revised surveillance operation.
A senior US official, who spoke to reporters on condition of anonymity, played down the surveillance violation as "a technological problem" rather than an intentional invasion of privacy.
"These documents released today will provide a strong indication to back up the statements we've been making from the beginning about the strong nature of the oversight of this program," said the official.
"This is not an egregious overreaching," he said, adding it was merely "an inadvertent problem that involved a relatively small number of US persons."
But the court, in its ruling, disagreed with the government's claim the collection was inadvertent and demanded the NSA change the program.
A Wall Street Journal report, meanwhile, said the NSA was able to trawl through 75 percent of Americans' email traffic. But intelligence officials called the account "simply not true."
"In its foreign intelligence mission, and using all its authorities, NSA 'touches' about 1.6%, and analysts only look at 0.00004%, of the world's internet traffic," the Office of the Director of National Intelligence said.
Citing the declassified documents, rights advocates expressed alarm at the scale of the surveillance and said the government had to do more to reassure the public.
"The FISA court opinion released today serves as further confirmation that the NSA is tapping the domestic Internet backbone," the Center for Democracy and Technology, a think tank, said in a tweet.
Democratic Senator Mark Udall -- a long-time critic of the surveillance programs --welcomed the NSA's decision to reveal the details of the episode but said more protections were needed to safeguard civil liberties.
"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," Udall said.
The government's biggest challenge was to restore the public's trust, said Sascha Meinrath, director of the Open Technology Institute.
"It's time for the Obama administration to come clean about the full scope of its activities," Meinrath said in a statement.
President Barack Obama has insisted that Americans' privacy rights are protected and that surveillance powers have not been abused in the search to uncover terror plots.
The scope of America's massive electronic spying effort -- which sweeps up Internet traffic and phone records -- was exposed starting in June when news outlets reported on documents leaked to them by Snowden.
The 30-year-old Snowden is wanted by the United States on espionage charges over his leaks but has obtained temporary asylum in Russia.
Sign up here with your email