President Trump on Thursday took aim at legislation the House was hoping to pass Thursday that would reauthorize a controversial surveillance tool, one that Trump says the Obama administration used to justify the "unmasking" of members of his campaign who were caught up in the surveillance of foreign nationals.

"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 asked on Twitter.

Trump backed off his critique of the surveillance law in a tweet later Thursday morning, one that reflected his administration's support for the reauthorization of the measure.

"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," he said. "We need it! Get smart!"

Still, Trump's blunt first message has the potential to put the bill even more at risk than it already was.

Related: GOP gambles with vote on controversial surveillance bill

The bill up in the House today would reauthorize Section 702 of the Foreign Intelligence Surveillance Act. That piece of the law allows surveillance of non-U.S. citizens outside the United States.

Trump and his supporters have bristled at the law because they believe the Obama administration inappropriately "unmasked" some of Trump's campaign team who were caught up in 702 surveillance. Those allegations, along with a general push from many members to ensure more protections from U.S. citizens, has made the bill controversial.

When the House votes Thursday, it's expected to first vote on a proposal from Rep. Justin Amash, R-Mich., to put more limits on how intelligence officials can use communications involving Americans.

If Amash's language were to pass, that would effectively gut the bill, and GOP leaders are expected to drop it entirely. Even if it could survive a final House vote, the Senate is not expected to consider it.

Wednesday night, the White House said it supports the underlying bill to reauthorize FISA, but not the Amash amendment.

"This amendment would re-establish the walls between intelligence and law enforcement that our country knocked down following the attacks of 9/11 in order to increase information sharing and improve our national security," the White House said.