Republicans pressed ahead Monday with a narrow fix to the migrant crisis created by President Trump, all but abandoning efforts for a far-reaching immigration overhaul that would fund a border wall and deal with the fate of young undocumented immigrants.

With Trump proving to be an unpredictable ally, deeply divided Republicans say they have little hope of rallying support for a broad package of reforms. However, GOP leaders are eager to adopt legislation that would make sure migrant children can remain with their parents at the border.

Haunting images of children in metal cages and reports of the government struggling to reunite families have touched off an international outcry that weighs heavily on the GOP five months before the midterm elections.

Sen. John Cornyn (Tex.), the Senate’s No. 2 Republican leader, told reporters Monday that lawmakers will try to pass a bill narrowly aimed at addressing the crisis this week. “Yeah, I mean, we should have done it last week,” he said. “But yeah, I hope so.”

The measure under discussion in the Senate would address a flaw in the executive order Trump issued last week mandating that migrant children and parents not be separated during their detention. That order would potentially violate a 1997 court order requiring that children be released after 20 days. The Senate GOP proposal would allow children to stay longer with their parents in detention.

However, there was no guarantee that the Senate could act before lawmakers break for the week-long Fourth of July recess. GOP leaders face skepticism from Democrats who are reluctant to sign on to a revised policy that they say could keep thousands of families in indefinite federal detention.

Democrats also have shown no willingness to help Trump deal with a crisis of his own making.

Senate Minority Leader Charles E. Schumer (D-N.Y.) sounded cautious Monday about the prospect of a deal coming together swiftly.

“I don’t know. It’s too early to tell, okay?” Schumer said. “We’ll certainly look at what people can come up with.”

Senate Republicans have also explored a relatively narrow fix that was introduced by Sen. Thom Tillis (R-N.C.) last week. The bill would add 225 immigration judges and take steps to prevent migrant families from being separated, including expediting court proceedings.

Tillis, Sen. Ted Cruz (R-Tex.) and two Democrats, Sens. Richard J. Durbin (Ill.) and Dianne Feinstein (Calif.), met late Monday to discuss the legislation.

Upon exiting, Feinstein called the huddle a “a good first meeting” but added, “Nothing’s going to happen this week, we don’t think.”

Durbin said there were some “basic philosophical disagreements” and explained that he and Feinstein emphasized they are not willing to pare back the protections for children under the 1997 court order. “Senator Feinstein and I both made it clear we are not going to water that down,” Durbin said.

His comment highlighted the difficulty Senate Republicans could face in trying to bring enough Democrats onboard this week to pass the Tillis plan or something similar.

In the House, days of last-ditch negotiations have convinced top Republicans that they are unlikely to pass a broad GOP immigration bill this week, prompting them to explore narrower legislation targeting the family separation policy.

Conservatives have rejected the broad bill as “amnesty,” concerned that it would offer a path to citizenship not only to the young undocumented immigrants known as “dreamers” but ultimately to their parents.

The legislation also would provide $25 billion for Trump’s long-sought border wall, impose limits on legal immigration and keep migrant families together in detention. House leaders prepared to bring the broad bill up for a vote as soon as Wednesday with its support still in serious doubt.

Rep. Mark Meadows (R-N.C.), the chairman of the conservative House Freedom Caucus and a key negotiator, said Monday evening that talks were ongoing but acknowledged that some lawmakers were eyeing a Plan B. “Everybody’s focused on the original bill right now, but they’re moving to, what do they do after that?” he said.

Meadows said Rep. Cathy McMorris Rodgers (R-Wash.), the No. 4 House GOP leader, was working on a narrower solution. A spokeswoman for McMorris Rodgers did not respond to messages seeking comment on Meadows’s claim.

Top Republicans have been loath to acknowledge that they would pursue a narrower bill focused on the separated children, hoping to keep alive a broad measure aimed at shrinking the gap between conservatives and moderates.

“We will cross that bridge if we get to it,” House Speaker Paul D. Ryan (R-Wis.) said last week.

But three GOP officials with knowledge of the talks said Monday that the changes under consideration are unlikely to bring around enough votes to pass the bill.

The talks have largely surrounded other issues, such as adding provisions to require employers to use a federal database to screen their workers’ legal status and expanding the number of temporary visas for agricultural workers.

In a Fox News Channel interview Monday, House Majority Leader Kevin McCarthy (R-Calif.) said the chamber would vote on the broader bill this week, and he blamed Democrats for its potential demise as well as the failure of a more conservative immigration bill last week.

“Not one Democrat would vote with us,” McCarthy said of that vote. “If they’re honest about wanting to secure the border, here’s the opportunity.”

But, more than Democrats, it is Trump who has emerged as an obstacle to a Republican immigration bill in the House. On Friday, he upended weeks of discussions by declaring that GOP lawmakers “should stop wasting their time” by trying to pass a bill now rather than waiting until after the midterm elections.

“We can pass great legislation after the Red Wave!” he said.

Trump is the one Republican best positioned to overcome the conservative opposition to the immigration bill in the House, but despite a trip to Capitol Hill last week, he has not gotten firmly enough behind the compromise push to assuage lawmakers who fear being outflanked from the right.

The White House continued to blame Democrats on Monday and declined to throw its weight squarely behind the GOP-crafted bill written to closely hew to an administration framework.

“The country has made extremely clear that they don’t want open borders, and Democrats need to understand that, and they need to work with Republicans and find some solutions,” said White House press secretary Sarah Huckabee Sanders.

While Republicans have repeatedly accused Democrats of favoring “open borders,” Democratic leaders have routinely endorsed increasing border security funding — including potential wall funding — in recent bipartisan immigration negotiations.

The sales job has largely been left to House Republican leaders, who have seen the recent negotiations not as a bona fide effort to pass legislation but as an attempt to placate furious moderates who circulated a petition last month to force votes on a bipartisan immigration bill.

In a late bid to secure support, backers of the bill have countered the notion that the parents of dreamers would in effect be eligible for a mass amnesty. Once the dreamers themselves go through the process to become citizens — a pathway of at least eight years, under the bill — their parents would be eligible to apply for visas that are set aside for the relatives of U.S. citizens.

But that would involve serious obstacles: Under current law, illegal immigrants who have lived in the United States for more than a year must return to their home country and wait 10 years before applying for any sort of visa.

Philip Rucker contributed to this report.