The National Security Agency said that it will no longer collect certain communications moving over the Internet for simply mentioning a foreign-intelligence target, in a move applauded by privacy advocates. (Patrick Semansky/AP)

The National Security Agency has ended a controversial surveillance practice of collecting email traffic merely because it contains the email address or phone number of a foreign target, a procedure that greatly increased the chances that purely domestic communications would be gathered.

The agency agreed to end the “about the target” collection to win approval from a federal court to continue a major surveillance program known colloquially as “Section 702” of the Foreign Intelligence Surveillance Act.

That’s a reference to part of a statute — the FISA Amendments Act of 2008 — that allows the NSA to gather from U.S. telecommunications and Internet providers the emails, phone calls, text messages and other electronic communications that could contain foreign intelligence.

The “about” collection was first reported by the New York Times amid a series of disclosures, beginning in 2013, by former NSA contractor Edward Snowden. Those revelations sparked months of national and international debate about the proper scope of government surveillance.

The “about” surveillance was the most problematic part of the upstream collection portion of Section 702, in which the agency gathers emails and text messages from telecom companies that own the infrastructure making up the backbone of the Internet.

Upstream collection is a comparatively small part of overall 702 collection. One estimate by the surveillance court in 2011 put it at about 9 percent. Even so, it could result in “a large overall number of purely domestic” communications, a privacy oversight board concluded in 2014.

The Foreign Intelligence Surveillance Court in 2011 found that the way the agency was conducting its upstream program violated the Constitution. The NSA proposed changes, which the court approved, allowing the “about” collection to continue.

But the NSA discovered last year that some analysts were querying the upstream data in violation of the rules. It reported the incidents to Congress and the surveillance court. The court issued two extensions as the NSA worked to fix the problems. Then on Wednesday, the court approved the agency’s proposed new rules to address the issue.

“After considerable evaluation of the program and available technology, NSA has decided that its Section 702 foreign intelligence surveillance activities will no longer include any upstream Internet communications that are solely “about” a foreign intelligence target,” the agency said in a statement Friday.

Instead, the NSA said, it will limit its collection to 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 agency said in a separate news release. The New York Times first reported the NSA’s decision.

“This was always the biggest stretch for Section 702 because it required the court to interpret the word ‘target’ in a way that was not what any normal person would expect,” said Timothy Edgar, a former privacy officer with the Office of the Director of National Intelligence, who is a senior fellow at Brown University’s Watson Institute for International and Public Affairs. In debating the law in 2008, Congress never contemplated “collection of messages that weren’t to or from a particular target,” he said.

Section 702 is one of the most important tools for collecting foreign intelligence, on everything from terrorist plots and cyber threats to nuclear proliferation and plans and intentions of foreign officials. Besides upstream collection, the agency gathers emails and other electronic communications from Internet providers in a downstream program previously known as PRISM.

A 2013 NSA document leaked by Snowden described PRISM as the most prolific contributor to the president’s daily intelligence brief. Section 702 is slated to expire at the end of this year and Congress must renew it or the authority to collect will disappear.

Section 702 authorizes the collection of foreign intelligence on U.S. soil without individualized warrants, but rather with an annual court certification. That lack of a traditional probable-cause warrant has raised privacy concerns that will loom large in this year’s debate over renewal of the law.