WASHINGTON — Hours before House showdown votes on immigration, President Donald Trump suggested today that any measure the chamber passes would be doomed in the Senate anyway.

His comments could weaken Republicans’ already uphill drive to pass legislation on an issue that’s become politically fraught amid heart-rending images of migrant families being separated at the U.S.-Mexican border.

The House prepared to vote today on a Republican immigration bill containing language aimed at halting the taking of immigrant children from parents being detained for illegally entering the U.S.

The measure has seemed like a long shot to pass, due to opposition by some GOP conservatives and Democrats, and Trump’s remark could complicate party leaders efforts to round up votes for it.

“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),” Trump tweeted. “Republicans must get rid of the stupid Filibuster Rule-it is killing you!”

In the unlikely event that the House approves the legislation, it seemed certain to go nowhere in the GOP-run Senate, where Democrats have enough votes to use a filibuster — procedural delays — to kill it. It takes 60 votes to end filibusters.

On Wednesday, Trump reversed himself and took executive action aimed at curbing the separation of families. His order seemed to stem some of the urgency for Congress to act. But House GOP leaders still were pulling out the stops to bring reluctant Republicans on board in hopes of resolving broader immigration issues ahead of the November midterm election.

Passage of the bill was always a long shot, but failure may now come at a steeper price as Republicans — and Trump — have raised expectations that, as the party in control of Congress and the White House, they can fix the nation’s long-standing immigration problems.

The outcome remains uncertain despite a frenzied effort to pull in the final votes. House Speaker Paul Ryan took two dozen wavering lawmakers to the White House so Trump could cajole them into supporting the bill.

Attorney General Jeff Sessions and Homeland Security Secretary Kirstjen Nielsen trekked to the Capitol to meet privately with groups of GOP lawmakers. Ahead of voting today, the results of the outreach were mixed.

“We have a chance,” said Rep. Carlos Curbelo, R-Fla. “It won’t be easy.”

One Republican, Rep. Joe Wilson of South Carolina, announced he would support the legislation after meeting with Trump, who he said was persuasive.

Another, Rep. Lou Barletta, who is running for Senate in Pennsylvania, told Trump at the meeting he would have to remain a no vote for a bill that many conservatives consider to offer amnesty.

The bill offers a potential pathway to citizenship to many young immigrants who arrived in the U.S. illegally as children but also provides money for Trump’s proposed border wall with Mexico.

The House bill is a compromise between the conservative and moderate factions that dragged on for several weeks.

The House will also vote on a more hard-line immigration proposal favored by conservatives. It is expected to fail.

The nearly 300-page compromise measure creates a path way to citizenship for the young immigrants known as Dreamers, who have been living in the U.S. illegally since childhood.

It provides $25 billion Trump wants for his promised border wall from Mexico. And it revises the long-standing preference for family visas in favor of a merit system based on education level and work skills.

When the crisis of family separations erupted at the border, GOP leaders revised the bill to bolster a provision requiring parents and children to be held together in custody. It did so by eliminating the 20-day cap on holding minors and allowing indefinite detentions.

Even though Trump has acted unilaterally to stem the family separations, lawmakers still prefer a legislative fix. The administration is not ending its “zero tolerance” approach to border prosecutions. If the new policy is rejected by the courts, which the administration acknowledges is a possibility, the debate could move back to square one.

Senate Republicans, fearing Trump’s action will not withstand a legal challenge and eager to go on record opposing the administration’s policy, have unveiled their own legislation to keep detained immigrant families together.

Back in the House, despite Trump’s endorsement of the compromise bill, Ryan’s leadership team has been struggling to ensure passage on its own. They have encountered persistent GOP divisions that have long prevented Republicans from tackling a broad immigration bill.

Moderate Republicans forced the immigration debate to the fore by threatening to use a rare procedure to demand a vote. Led by Curbelo and Rep. Jeff Denham, R-Calif., many are from states with large populations of young Dreamer immigrants who now face deportation threats under Trump’s decision to end the Obama-era Deferred Action for Childhood Arrivals program. A federal court challenge has kept the DACA program running for now.

Ryan wanted to prevent moderates from being able to force a vote and launched weeks of negotiations to develop the compromise package with Rep. Mark Meadows, R-N.C., and conservatives.

Trump, who remained on the sidelines for much of the debate, almost upended the process late last week by saying he would not back the compromise bill.

GOP aides later said he had been confused. Trump quickly reversed course to back the bill and swooped into the Capitol for a late huddle Tuesday with Republicans.

Associated Press writers Alan Fram and Kevin Freking contributed to this report.