House Republicans were prepared to vote on a pair of immigration reform bills Thursday afternoon — but President Donald Trump suggested that they were wasting their time because neither of the measures was likely to get through the Senate.

“What is the purpose of the House doing good immigration bills when you need 9 votes by Democrats in the Senate, and the Dems are only looking to Obstruct (which they feel is good for them in the Mid-Terms). Republicans must get rid of the stupid Filibuster Rule-it is killing you!” the president tweeted Thursday morning.

Some lawmakers said that Trump’s tweet would make it harder to pass either bill, both of which face opposition from conservative immigration hardliners in the lower chamber.

“Wow, this undermines getting undecided GOP members to support the compromise,” Rep. Ryan Costello (R-Pa.) wrote on Twitter following Trump’s tweet.

And some experts said Trump’s order to halt the policy of separating children from families caught illegally crossing the Mexican border only created more chaos and confusion.

“I think the intention was to change things. I think there is a lot of confusion. Frankly, I think the way the order is drafted is not executable,” John Sandweg, a former director of US Immigration and Customs Enforcement in the Obama administration, told CNN.

“I was really shocked to see they are not going to unite the kids. I thought the whole point of this was to reunite the kids,” he said.

The House on Thursday was debating a conservative option that would include tough enforcement of immigration laws but omit a guaranteed path to citizenship for the “Dreamers.”

The second bill was a compromise between the House GOP’s conservative and moderate wings that nonetheless still faced conservative opposition.

Critics from the Kids in Need of Defense advocacy group charged that both House bills were too harsh because they would allow children to be detained indefinitely, make it easier to deport children and slash the number of immigrants who could be granted asylum.

“The two Republican bills House Speaker Paul Ryan plans to bring to a vote would decimate protections for unaccompanied children, asylum seekers, and other vulnerable immigrants and refugees,” the group said in a statement.

“These politically motivated bills not only fail to sufficiently address the insecurity facing thousands of Dreamers and immigrant youth, but will imperil the lives of thousands of unaccompanied children and asylum seekers.”

Trump a day earlier abruptly signed an executive order reaffirming his zero tolerance policy on immigration but ending the separation of migrant children from their families at the border.

But nothing in his order mentioned the fate of the more than 2,300 migrant children in federal custody — including hundreds housed at various locations in New York.

The House bills would undo a federal court agreement that limits the time that minors here illegally can be held in custody to 20 days, which would allow them to be with their parents in a detention facility indefinitely.

But neither the Department of Homeland Security nor the Department of Health and Human Services have revealed what plans they had to reunite the children with their parents.

Despite the confusion, House GOP leaders were still trying to build support for a bill negotiated among conservative and moderate factions of the party.

Ryan said Thursday morning that reuniting families was a priority but didn’t say how it would happen.

“Obviously we want to see families reunited,” he said, without elaborating.

Asked what would happen if neither bill passed, he said: “We’ll cross that bridge when we come to it. Let’s take it one step at a time.”

Despite his tweet, Trump has said he would support either of the bills the House is considering.

Lawmakers are struggling to move past a debate that has become politically fraught amid the dire images of families being separated at the border.

Meanwhile, House and Senate Democrats are demanding that Trump reunify the families that were separated at the border.

Democratic leaders Chuck Schumer in the Senate and Nancy Pelosi in the House sent a letter Thursday to the White House urging the president to do everything necessary to reunite the more than 2,300 children with their families.

With AP