U.S. President Donald Trump waves after addressing the annual March for Life rally, taking place on the National Mall, from the White House Rose Garden in Washington, U.S., January 19, 2018. REUTERS/Carlos Barria

By Dustin Volz

WASHINGTON (Reuters) - U.S. President Donald Trump on Friday said he signed into law a bill renewing the National Security Agency's warrantless internet surveillance program, sealing a defeat for digital privacy advocates.

"Just signed 702 Bill to reauthorize foreign intelligence collection," Trump wrote on Twitter, referring to legislation passed by the U.S. Congress that extends Section 702 of the Foreign Intelligence Surveillance Act (FISA).

The law renews for six years and with minimal changes the National Security Agency (NSA) program, which gathers information from foreigners overseas but incidentally collects an unknown amount of communications belonging to Americans.

The measure easily passed the U.S. House of Representatives last week despite mixed signals posted on Twitter by Trump and narrowly avoided a filibuster in the Senate earlier this week that split party lines. The measure had drawn opposition from a coalition of privacy-minded Democrats and libertarian Republicans.

In his tweet on Friday, Trump attempted to clarify why he signed the bill despite repeating an unsubstantiated claim that his Democratic predecessor, Barack Obama, ordered intelligence agencies to eavesdrop on Trump's 2016 Republican presidential campaign.

"This is NOT the same FISA law that was so wrongly abused during the election," Trump wrote. "I will always do the right thing for our country and put the safety of the American people first!"

Last September, the U.S. Justice Department said in a court filing that it had no evidence to support Trump's claim about improper surveillance during the campaign.

Without Trump's signature, Section 702 had been set to expire on Friday, though intelligence officials had said the surveillance program could continue to operate until April.

Under the law, the NSA is allowed to eavesdrop on vast amounts of digital communications from foreigners living outside the United States via U.S. companies like Facebook Inc, Verizon Communications Inc and Alphabet Inc's Google.

But the program also incidentally scoops up Americans' communications, including when they communicate with a foreign target living overseas, and can search those messages without a warrant.

The White House, U.S. intelligence agencies and congressional Republican leaders have said the program is indispensable to national security, vital to protecting U.S. allies and needs little or no revision.

Privacy advocates say it allows the NSA and other intelligence agencies to grab data belonging to Americans in a way that represents an affront to the U.S. Constitution.

(Reporting by Dustin Volz; Editing by Sandra Maler and Jonathan Oatis)