WASHINGTON: The Republican-led House resoundingly rejected a far-ranging immigration bill Wednesday despite an eleventh-hour endorsement by President Donald Trump, as the gulf between the GOP’s moderate and conservative wings proved too deep for leaders to avert an awkward election-year display of division.

The bill was killed 301-121, with nearly half of Republicans opposing the measure. The depth of GOP opposition was an embarrassing showing for Trump and a rebuff of House leaders, who’d postponed the vote twice and proposed changes in hopes of driving up the tally for a measure that seemed doomed from the start.

The roll call seemed to empower GOP conservatives on the fraught issue. Last week, a harder-right package was defeated but 193 Republicans voted for it, 72 more than Wednesday’s total. In Wednesday’s vote, 112 Republicans voted “no,” including many of the party’s most conservative members.

“We need to start securing the border and not reward bad behavior, and that’s what this bill did,” said Rep. Roger Williams, R-Texas. Conservatives have opposed the bill’s provision offering a chance at citizenship for hundreds of thousands of immigrants who came to the U.S. illegally as children. Calling it amnesty, they have said it doesn’t do enough to limit the number of relatives who immigrants here legally can sponsor for residence.

Even if it passed, the bill rejected Wednesday would have been dead on arrival in the closely divided Senate, where Democrats have enough votes to kill it. House Democrats voted unanimously against it.

“Show some compassion,” said Rep. Adriano Espaillat, D-N.Y., who came to the U.S. from the Dominican Republic with his parents at age 9. “Will we step up to be the country that allowed me, as a young boy, to find safety with my mother and father?”

GOP leaders have been considering a Plan B: a bill focused narrowly on barring the government from wresting children from migrant families caught entering the country without authorization. With television and social media awash with images and wails of young children torn from parents, many Republicans have wanted to pass a narrower measure addressing those separations before Congress leaves at week’s end for its July Fourth break.

But that seemed unlikely. GOP aides said Republicans had yet to agree on bill language, and the effort was complicated by a federal judge who ordered that divided families be reunited with 30 days. Republicans have been working on legislation that would keep migrant families together by lifting a court-ordered, 20-day limit on how long families can be detained.

Senators are trying to craft a bipartisan plan. Trump has issued an executive order reversing his own family separation policy, but around 2,000 children remain removed from relatives and are generating damaging daily stories that Republicans would love to halt.

After the vote, Rep. Carlos Curbelo, R-Fla., said too many lawmakers “simply lacked the courage” to help “victims of a broken immigration system.”