The US government spied on electronic communications between Americans with no links to terror suspects until a judge ruled it illegal in 2011, officials admit.
The unlawful program, which spanned three years and 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 on Wednesday 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 National Security Agency (NSA) had diverted a massive trove of international data flowing through fibre-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.
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.
Long-time critic of the surveillance programs, Democratic Senator Mark Udall, 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.

