The National Security Agency is set to stop using a highly classified program that in part collected Americans' emails and text messages without a warrant.

Details of the program were largely overlooked when it was first disclosed in documents leaked by whistleblower Edward Snowden in 2013. The leaks provided a small but critical window into how the US government carries out surveillance on Americans, who are largely off-limits thanks to constitutional protections.

The program allows the NSA to collect and search the emails and text messages to and from Americans who mention names, email addresses, phone numbers, or other kinds of details about foreign targets under government surveillance.

This so-called "about the target" surveillance may help officials seek out Americans who are linked to terrorism or carry out espionage, but critics argue that this kind of surveillance goes far beyond the collection of who people talk to and when, rather than the contents of those calls messages.

News of the program's shutdown was first reported by The New York Times on Friday, citing an official familiar with the matter.

The controversial program was reviewed in 2011 by the Foreign Intelligence Surveillance Court, which authorizes the government's surveillance programs. It found that the NSA was collecting messages domestically as a technical flaw in the surveillance program.

The court said the program can continue so long as incidentally collected "bundled" data is stored in a separate, compartmentalized system that NSA analysts wouldn't readily have access to.

But, last year, analysts were still querying the bundled data in a way that wasn't compliant with the court's ruling and the Fourth Amendment, designed to protect against unreasonable searches and seizures.

The NSA informed the Foreign Intelligence Surveillance Court of the violation, which led to a delay in the court's authorization of the program.

The NSA later pulled the plug on the program altogether.

NSA spokesperson Mike Halbig did not address specific questions emailed prior to publication, but a prepared statement confirmed that program would stop.

"NSA will no longer collect certain internet communications that merely mention a foreign intelligence target," the statement said. "This information is referred to in the Intelligence Community as 'about' communications in Section 702 'upstream' internet surveillance. Instead, NSA will limit such collection to internet communications that are sent directly to or from a foreign target."

"Even though NSA does not have the ability at this time to stop collecting 'about' information without losing some other important data, the Agency will stop the practice to reduce the chance that it would acquire communications of U.S. persons or others who are not in direct contact with a foreign intelligence target," the statement read.

NSA also confirmed it will "delete the vast majority of previously acquired upstream internet communications as soon as practicable."

VIDEO: NSA halts domestic digital surveillance program over privacy issues