House passed legislation to renew the Foreign Intelligence Surveillance Act, otherwise known as FISA. The bill reauthorizes for six years a powerful government authority to conduct foreign surveillance on U.S. soil.

A series of contradictory and seemingly misinformed tweets from President Trump on Thursday morning upended the debate in Congress over a government surveillance program, with top Democrats pressing Republican leaders to pull a bill from the House floor that would reauthorize the spying powers.

Republicans seemed undeterred by Democrats’ demands, however, plowing ahead with a planned vote on a sole amendment to the bill Thursday morning.

The tweets complicate what was already a difficult road ahead for supporters of the measure, potentially jeopardizing the future of a program that the intelligence community has identified as its most critical national security surveillance tool.

Trump sent mixed signals on the program, known as FISA and which his White House supports, in his tweetstorm. First he questioned his administration’s position on the program after seeing a segment on Fox News, and then he seemed to reverse course and urge legislators to approve FISA’s reauthorization 90 minutes later.

In his first tweet, Trump linked FISA, which his White House supports, to the dossier that alleges his campaign had ties to Russia, catching aides and Capitol Hill officials off guard and drawing the ire of his critics for misconstruing what the program actually does.

“‘House votes on controversial FISA ACT today,'” Trump wrote, citing a Fox News headline. “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 top Democrats on the House and Senate intelligence committees were quick to leap on the tweet as “irresponsible” and “untrue.”

“FISA is something the President should have known about long before he turned on Fox this morning,” Sen. Mark R. Warner (D-Va.), ranking member on the Senate Intelligence Committee, tweeted after Trump’s post.

House Republicans were meeting for a regular Thursday conference session when the first of Trump’s tweets came out, sending a wave of concern through the room. Trump then called House Speaker Paul D. Ryan (R-Wis.), and they spoke for half an hour. Later, House Majority Leader Kevin McCarthy (R-Calif.) alerted the GOP conference that the president had tweeted again, calming lawmakers’ nerves.

In his second tweet, about an hour later, Trump seemed to backtrack, pushing for the act to be re-upped.

“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!” Trump wrote on Twitter.

It is unclear how Trump “personally directed the fix to the unmasking process since taking office,” since the bill’s author, House Intelligence Committe Chairman Devin Nunes (R-Calif.), stripped the major changes to unmasking procedures from the measure before presenting it for a vote by the full House.

Senior government officials can ask spy agencies to unmask the names of Americans or U.S. organizations if they believe that will help them better understand the underlying intelligence. Trump, and Nunes, accused the Obama administration of improperly revealing the identities of members of the president’s transition team. It is unclear what the dossier has to do with unmasking or the reauthorization of the spying program, but Trump has been repeatedly denouncing it in recent days.

Both Republicans and Democrats have pushed back against linking the controversy over unmasking to the FISA program the House is seeking to extend, known as Section 702. On Thursday, White House cyber coordinator Rob Joyce said there have “been no cases of 702 used improperly for political purposes.”

The bill the House was scheduled to vote on Thursday would reauthorize for six years the government’s powerful Section 702 authority to collect the emails and other communications of foreign targets located overseas from U.S. companies. The statutory authority for the program expires Jan. 19.

Privacy advocates in Congress object to the measure and want to amend it so that law enforcement agencies would have to get warrants before being able to scour the database of those records for information about Americans who may have been in touch with foreign targets. The underlying bill only requires the government to seek a court order when they want to use what they find about Americans in criminal cases.

Trump’s administration has pushed for the FISA program to be reauthorized, with FBI Director Christopher A. Wray calling it a valuable tool to fight terrorism. The White House has issued statements this week and asked lawmakers to reauthorize it, even urging members late Wednesday night to reject a proposed amendment to the measure that would weaken the bill and likely kill its chances of passage in the Senate.

Trump’s tweet came shortly after a “Fox and Friends” segment that highlighted the FISA program, calling it “controversial.” Trump first seemed to side more with civil liberties groups like the American Civil Liberties Union, House Democrats and others, such as Sen. Rand Paul (R-Ky.) who have pushed for less invasive measures.

Ellen Nakashima and Erica Werner contributed to this report.