After a few confusing tweets, President Donald Trump on Thursday pushed the House to renew a critical national security program that allows spy agencies to collect intelligence on foreign targets abroad.

The House is expected to vote on a version that would put restrictions on how the FBI could use information on Americans that is inadvertently swept up by the program. "This vote is about foreign surveillance of foreign bad guys on foreign land," Trump said in a morning tweet. "We need it! Get smart!"

But before that he sent out a tweet suggesting that the program was used to collect information that might have been used to taint his campaign.

Rep. Adam Schiff of California, the ranking Democrat on the House intelligence committee, said Trump's tweets were "inaccurate, conflicting and confusing." He suggested that a vote on the bill should be delayed until the White House's position can be ascertained. The Republicans said the vote should be held.

The program, known as Section 702 of the Foreign Intelligence Surveillance Act, allows U.S. spy agencies to collect information on foreign targets outside the United States. Americans' communications are inadvertently swept up in the process and privacy advocates and some lawmakers want to require the FBI to get a warrant if it wants to query and view the content of Americans' communications that are in the database to build domestic crime cases.

On Thursday morning, the president appeared to contradict the position of his own administration. In a tweet, he linked the FISA program that his White House supports to the dossier that alleges his campaign had ties to Russia, catching aides and Capitol Hill officials off guard. A short time later, he went further.

"'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?"

Trump's position seemed to be in opposition to the Trump administration's position, potentially putting the reauthorization vote in doubt. His tweets came shortly after a "Fox and Friends" segment that highlighted the FISA program, calling it "controversial." Republican Sen. Rand Paul of Kentucky, who has also made the television rounds in recent days, has pushed for less invasive spying measures.

The tweets sent White House aides scrambling to explain the apparent about-face. The president's reversal was yet another example of him seemingly taking cues from television, particularly the morning Fox News show, while also personalizing an issue, in this case the dossier, over a policy position.

There are no obvious links between the dossier and the reauthorization of the spying program, but Trump has repeatedly denounced the document in recent days. The president has said that his campaign and Trump Tower was spied on by the Obama administration, calling the former president a "bad (or sick) guy!" He has offered no proof for such claims.

About an hour after taking a stance against reauthorization, Trump seemed to backtrack and pushed for the act to be re-upped.

"Today's vote is about foreign surveillance of foreign bad guys on foreign land. We need it! Get smart!" Trump wrote on Twitter.

A White House official said staffers had consulted with Trump after his initial tweets opposing the administration's stance.

The FBI and intelligence agencies say being able to query the database is essential to keeping America safe.

FBI Director Christopher Wray has said that tips are flooding into the FBI by the thousands. It's at this initial stage — where leads are sifted and prioritized — when foreign intelligence can be queried to help connect dots and spot possible national security threats, he said.

In a recent speech, Wray said: "I'm going to say this over and over and over again. Every court to look at 702 and the way it's been used, including the FBI queries, have found it fully consistent with the Fourth Amendment."

Lawmakers in the House are weighing whether the FBI should have to get a warrant to either query information on Americans in the database or seek a warrant only if the FBI wants to actually view the contents of the material and use it for investigating and prosecuting domestic crimes.

The Trump administration had wanted the program to be reauthorized without change, but later said it was willing to back legislation that would impose moderate restrictions on the FBI access to Americans' communications.

The White House opposes a requirement that would require the FBI to get a warrant before even querying lawfully collected foreign intelligence for domestic cases, although not in emergencies or cases involving national security.

___

AP Writer Jonathan Lemire at the White House contributed to this report.