Officials revealed that a judge in the Foreign Intelligence Surveillance Court ruled the programme illegal in 2011.
The US government faces mounting criticism over its surveillance operations after the leaks of whistle-blower Edward Snowden.
The court, whose rulings are normally kept secret, said the NSA may have violated US law for collecting as many as 56,000 emails on an annual basis between 2008 and 2011.
But intelligence officials speaking to reporters anonymously say the scooping of emails was unintentional, blaming it on a technological problem.
The NSA was unable to separate out emails between Americans with no direct connection to terrorism, so the agency was collecting tens of thousands of “wholly domestic communications” every year, the court documents said.
In the ruling, Judge John Bates criticized the NSA over the breach of privacy, marking it as “the third instance in less than three years in which the government has disclosed a substantial misrepresentation regarding the scope of a major collection programme”.
The court found that the data gathering violated the Fourth Amendment of the US Constitution, prohibiting “unreasonable searches and seizures”.
The court’s opinions, which are usually kept secret, were revealed by the government in response to a Freedom of Information request.
Government officials said that the court rulings had been declassified to show that eavesdropping programmes at fault had been found and fixed, highlighting its oversight measures.
The scope of the NSA’s massive surveillance programme, which sweeps up internet traffic and phone records, was exposed in June in leaks to media by former NSA contractor Edward Snowden.
Earlier this month, President Barack Obama promised to be more transparent about US spying programmes, with “appropriate reforms” to guarantee greater oversight.
myqdL2nvZ_kThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…