Weeks of futile negotiations that ended in a pair of failed votes have left House Republicans bitterly divided over remaking the nation’s immigration laws and without a solution to President Trump’s migrant-separation policy or the uncertain fate of young undocumented immigrants.

The frustrations have been especially pronounced among moderates, who moved last month to force action on immigration after it became clear that House GOP leaders preferred to wait until after the midterm elections.

Leaders of the moderate bloc say the outcome has proved that no Republican-written bill can pass the House. The only solution for so-called dreamers, they say, will be to compromise with Democrats on a narrower bill.

“We gave them not only the ‘four pillars’ with the president’s support and him saying he was willing to sign it but also gave them the most conservative bill on the floor that they will see,” said moderate Rep. Jeff Denham (R-Calif.). “Anything in the future will not tackle as many issues as this bill.”

The moderates, however, have not been able to force votes on bipartisan bills that would have passed with mostly Democratic votes. Instead, they had to settle for negotiations with Republican hard-liners who ultimately declined to back a broad measure that would have granted a path to citizenship to the young, undocumented immigrants and addressed the separation of migrant children from their parents at the U.S. border in the Southwest.

It remains unclear whether immigration legislation of any kind will be up for congressional consideration before the elections in November. President Trump tweeted a week ago that GOP lawmakers would be “wasting their time” to further pursue immigration legislation until more Republicans are elected to Congress.

In the House, conservatives say they now have the upper hand after their hard-line bill came much closer to passage — garnering 193 votes to the broad bill’s 121. Top House leaders on Thursday continued to blame Democrats, not their own internal divisions, for the lack of progress.

Meanwhile, Democrats who joined forces with the moderates to spark the early-summer immigration debate but were excluded from the subsequent negotiations are hardly jumping to restart any bipartisan effort.

“It definitely has the feeling that people are going to go back into their camps for a little bit,” said Rep. Pete Aguilar (D-Calif.), who worked with Denham and other Republicans to force the debate. “The dynamics are exactly the same. . . . It’s whether we can force action, and now Republicans gave up their leverage to force action.”

House Republican leadership aides said Thursday it is unlikely that the chamber will take up further immigration legislation before the elections. But lawmakers in both parties still think Congress could be forced to act to resolve the family-separation crisis or the fate of dreamers, who would be subject to deportation if courts uphold Trump’s cancellation of the Deferred Action for Childhood Arrivals program.

DACA could be put back in peril as soon as next month, when a federal district judge in Texas is expected to rule on a case challenging the program’s legality. Barring action from higher courts, that could put hundreds of thousands of dreamers at risk by the end of summer.

Meanwhile, the family separations in the Southwest remain a live issue. Trump’s executive order only partially reversed his policy decision that led to the separations, and a federal court ruling this week gave the Trump administration 30 days to reunite the families now in custody. Lawmakers said the House could well be asked to take up unresolved issues before leaving for its summer recess in late July.

An unlikely spark for further action is a new “discharge petition,” which is what the Republican moderates in conjunction with Democrats used to rekindle the immigration debate in May. The organizers have had informal talks about restarting the process to push a bipartisan immigration bill that would protect dreamers and beef up border security, but they face a daunting deadline: 218 lawmakers would have to sign it by July 10 — the day House members are to fly back into Washington after their 10-day holiday break.

“I just don’t think that that’s very likely,” Aguilar said, noting that Republicans would have to put up even more signatures than on the original petition, which fell two GOP signatures short of the 25 needed. “We’re not going to go on a ledge if they don’t have real support for it.”

The Republicans who negotiated the failed bill, meanwhile, were left to reflect on how they might pick up the pieces.

“I think it flushed out where a lot of people’s positions are,” said Rep. Mark Walker (R-N.C.), who participated in the talks as chairman of the Republican Study Committee. “Republicans are going to have to make a decision: If you want all these other things, are you going to be able to get to a place for some kind of DACA resolution? If Republicans in general aren’t willing to get there, then it’s going to be a tough situation.”

For Denham, the negotiating process has been a series of frustrations — including watching Republican colleagues who he believed would sign the petition to bring the bills to the floor instead abandon it; sitting at a negotiating table across from conservatives who, he said, kept shifting their demands; and watching Trump give, at best, an uneven sales pitch for the resulting legislation.

At one point last week, Denham recalled, he became so angry at conservative Rep. Raúl R. Labrador (R-Idaho) in a closed-door meeting that Majority Leader Kevin McCarthy (R-Calif.) had to tell him four times to shut up, “louder each time.”

“We just wanted to negotiate in good faith, but every time you come to a meeting, you have a whole new list of demands,” he said.

Conservatives see things differently. They say the mainstream of the House Republican conference is closer to their views — demanding not only the border-wall funding and cuts to legal migration that were in the broad bill but also favoring a crackdown on “sanctuary cities” that do not cooperate with law enforcement, requiring employers to screen out illegal immigrants, and offering dreamers a much narrower path to legal status.

Those elements were in the alternative bill that won 193 votes last week.

“If we can’t get that bill across the finish line — with slight modifications, maybe — then maybe the president’s right on target,” said Rep. Jim Jordan (R-Ohio), referring to the “wasting their time” remark. “This is second-grade math: We’re close with that bill. . . . 112 Republicans voted against the bill yesterday. And somehow it’s the Freedom Caucus’s fault?”

But to the moderates, kowtowing to conservatives is a recipe only for more false starts.

“You go more conservative, it’s going to drive the number down; it’s not going to drive it up,” said Rep. Tom Reed (R-N.Y.), who signed the original discharge petition. “So the bottom line is, in my opinion, reach out to the Democratic members who want to govern.”