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_kImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…