Jan. 11 (UPI) -- The U.S. House on Thursday passed legislation reauthorizing a surveillance act after President Donald Trump first criticized the bill, and then backed it.
The House approved the legislation 256-164 with support from Democrats and Republican leadership to extend the program for six years. It now goes to the Senate.
Two postings Thursday on Twitter by Trump came before the House was scheduled to vote later in the day on making changes to reauthorization of the Foreign Intelligence Surveillance Act.
American firms, including Google and AT&T, are now required to turn over information to authorities without a warrant turn over private emails and other messages of Americans linked to foreigners' communications in counterterror and espionage cases. A proposed amendment to Section 702 to require authorities to obtain court warrants failed 233-183 with support from libertarians and privacy advocates.
White House press secretary Sarah Huckabee Sanders on Wednesday night issued a statement asking lawmakers to vote against the legislation with the changes.
But in his first tweet Thursday, Trump wrote: "House votes on controversial FISA ACT today. This is the act that may have been used, with the help of the discredited and phony Dossier, to so badly surveil and abuse the Trump Campaign by the previous administration and others?"
The dossier examines ties between Russia and Trump and his aides.
The tweet was posted shortly after Fox News legal analyst Andrew Napolitano said, "Mr. President, this is not the way to go. Spying is valid to find the foreign agents among us. But it's got to be based on suspicion and not an area code." He said Trump's "woes" began with surveillance.
Hours later, the president appeared to back off supporting the limits by writing: "With that being said, I have personally directed the fix to the unmasking process since taking office and today's vote is about foreign surveillance of foreign bad guys on foreign land. We need it! Get smart!"
House Speaker Paul Ryan, R-Wis., and Trump spoke by phone between the president's two tweets, a senior Republican congressional aide told The New York Times.
"I think [House Republicans] just needed more clarification. Was there support? What was the concern? What were his issues?" said House Republican Study Committee Chairman Mark Walker of North Carolina told Politico. "For members who were somewhat undecided or lean-no or lean-yes, if the president comes in and weighs in on something, I think that is impactful. And that's why they wanted to make sure that at the end of the day, or at the end of this conversation, that he is supportive overall of this bill."
Trump's original tweet enraged Democrats who have been working with moderate Republicans to reauthorize the legislation.
Sen. Mark Warner of Virginia, the top Democrat on the Senate's intelligence committee, criticized the president.
"This is irresponsible, untrue, and frankly it endangers our national security," Warner tweeted. "FISA is something the President should have known about long before he turned on Fox this morning."