WASHINGTON – With President Donald Trump suddenly more antagonist than ally, House Republicans confronted the grim reality Friday that they may have no way out of an immigration mess of the president's own making.

They prepared for a last-ditch legislative effort next week with little expectation it would succeed, as their frustrations with the president became palpable. Midterm elections loom with every House seat on the ballot, but the president, who will not face voters in November, airily predicted a “Red Wave” of GOP victories that few congressional Republicans expect – and told lawmakers to wait until then to deal with the immigration dilemma.

Many Republicans believe they don't have the luxury of waiting, both because of internal House politics and because of the unfolding crisis of border separations that the president himself has insisted demands an immediate legislative solution.

“We reached, I think, a good consensus, and suddenly we wake up to another tweet,” said Rep. Dennis Ross, R-Fla. “And it's like, I think he's with us, but he's got to really come out for us. This is the opportunity.”

Republican leaders have struggled to rally support for a broad bill designed to unite GOP moderates and conservatives, postponing a vote twice in the face of opposition. The bill largely follows immigration principles issued by the White House in January, providing $25 billion for Trump's long-sought border wall, scaling back legal immigration and giving young undocumented immigrants a shot at citizenship.

The bill also would allow migrant families to remain together in detention.

The mercurial Trump, who repeatedly called for Congress to act, tweeted Friday morning: “Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November. Dems are just playing games, have no intention of doing anything to solves this decades old problem. We can pass great legislation after the Red Wave!”

Republican leaders said a vote on the bill would occur next week regardless of Trump's wishes. But Trump's tweet, said Rep. Patrick McHenry, R-N.C., “is very much in reality on the difficulties of immigration reform, and it also is the reality given the partisan nature of our current environment in a political year.”

Rep. Bradley Byrne, R-Ala., a deputy whip who has been involved in vote-counting discussions, said it's unclear whether the effort will be worthwhile.

“If the president said to a given bill, 'That's my bill; that's the one I want' – I think that would have a pretty significant impact on our discussions,” Byrne said. “But he hasn't done that yet, and so we're continuing to work without that.”

Amid an outcry over his migrant separation policy, Trump traveled to Capitol Hill on Tuesday, urging lawmakers to pass either of two rival bills that sought to defuse the crisis as well as the uncertain status of young undocumented immigrants at risk for deportation because of his cancellation of the Deferred Action for Childhood Arrivals program.

Then came Friday morning's tweet.

“What has become clear is that this president has no goal posts for what he wants to achieve on immigration because it's actually, in his mind, a useful political tool,” said Rep. Pramila Jayapal, D-Wash., a member of the House Judiciary subcommittee on immigration. “It says exactly who he is, which is callous, conniving and really not focused on trying to solve any problems.”

Last year, after meeting with Trump, Senate Minority Leader Charles Schumer, D-N.Y., and House Minority Leader Nancy Pelosi, D-Calif., said they had reached a deal to protect “Dreamers” in exchange for funding Trump's border wall. But the deal fell apart later when the White House insisted on including other Trump priorities on immigration in the package.

Last month, Republican moderates moved to force votes on several immigration bills – including bipartisan measures that would easily pass with mostly Democratic support. But GOP leaders, who feared a conservative political backlash if a Republican House advanced such legislation, undertook a furious push to stymie the moderates.

Congress could be forced to act on immigration regardless in the coming weeks. The executive order Trump signed is contingent on the modification of a court settlement that requires children to be released from detention after 20 days.