Kirill Kudryavstev/AFP via Getty Images NSA ends collection of digital communications about foreign targets The decision comes as Congress is locked in heated debate over portion of the law that authorizes such collection.

The NSA will stop its controversial practice of collecting digital communications that merely mention foreign surveillance targets, the agency confirmed on Friday.

In a rare public statement, the NSA said it made the change because of "technical constraints" and privacy concerns about Americans whose data was being collected.

The decision comes as Congress is locked in a heated debate over whether to revise and reauthorize the portion of the law that authorizes such collection — Section 702 of the Foreign Intelligence Surveillance Act. The provision expires at the end of the year unless Congress acts.

Section 702 programs have also been in the spotlight since it was revealed that Trump transition team officials incidentally had their communications swept up through legal government surveillance operations possibly authorized under 702.

While the move was greeted as a positive step by surveillance critics on and off Capitol Hill, privacy advocates say it does little to placate their broader concerns about the programs and vowed to continue a legislative push to amend the law.

Critics believe the programs constitute warrantless and unconstitutional searches on Americans, but proponents defend the programs as vital to collecting information on overseas terrorists and criminals.

Under Section 702, the NSA sweeps up emails and text messages that reference foreign targets, including communications that mention targets’ email addresses or phone numbers. This is in addition to the NSA’s collection of digital chatter to or from those targets themselves.

But as the secret court that oversees the NSA's overseas spying operations was reviewing the Justice Department’s latest request to preserve its Section 702 powers, the NSA discovered that it had accidentally mishandled data on Americans incidentally swept up in the spy program.

When the agency reported the issues to the Foreign Intelligence Surveillance Court, the court asked for more information and refused to grant a full Section 702 recertification until the problem was addressed, according to the NSA's statement. The NSA then launched a broad review of Section 702 and eventually decided to end its so-called “about” collection.

“These changes," the NSA said, are meant to retain the "collection that provides the greatest value to national security while reducing the likelihood that NSA will acquire communications of U.S. persons or others who are not in direct contact with one of the Agency's foreign intelligence targets."

The secretive surveillance agency also said it would “delete the vast majority of previously acquired upstream internet communications as soon as practicable.”

Privacy advocates applauded the move, but cautioned that it was voluntary and did not address the underlying legal concerns they have with Section 702.

Rep. Ted Poe, a civil-liberties-minded Republican from Texas, called the decision a "necessary step in the right direction" in a statement to POLITICO, adding that the practice was "inconsistent with the Constitution."

Sen. Ron Wyden (D-Ore.), a leading surveillance critic on Capitol Hill, said he will introduce legislation to codify the NSA's decision.

"This change ends a practice that allowed Americans' communications to be collected without an warrant merely for mentioning a foreign target," Wyden said in a statement.

Off Capitol Hill, digital rights activists pushed Congress to go further. They are hoping privacy-minded lawmakers will use Section 702's sunset clause to inject more transparency measures and privacy protections into the law.

Neema Singh Guliani, a surveillance policy expert at the American Civil Liberties Union, said the NSA’s decision “increases the pressure on Congress to closely look at this program.”

“To me it’s very notable that the government had trouble complying with procedures that were put in place,” she told POLITICO, cautioning that the move offered no assurance the government wouldn't reverse its decision down the line.

Amie Stepanovich, U.S. policy manager at Access Now, called on the Trump administration to step in and “support statutory changes to provide legal certainty that it will remain in effect.”

Cory Bennett and Martin Matishak contributed to this report.