After weeks of rocky negotiations, House Republicans on Wednesday defeated a plan from Speaker Paul Ryan that attempted to marry conservative and moderate provisions to legalize "Dreamers" and secure the border.

The bill failed with no votes from Democrats, and it got even less support from Republicans than the more conservative bill that failed last week.

[Related: These are the 41 Republicans who killed the Goodlatte immigration reform bill]

The House handily rejected it in a 121-301 vote that split Republicans almost perfectly in half, 121-112.

Republican leaders expected the bill to fail, and were already planning to quickly take up a very narrow bill that would allow immigration officials to hold children with adult family members at border residential facilities while the adults are prosecuted for illegal entry. Lawmakers could vote on that bill Thursday, before the House leaves town for a week, GOP aides said.

The border language had been included in the compromise legislation from Ryan, R-Wis., and from the more conservative bill that failed last week. But neither of the broader bills were able to pass.

The Ryan bill would have provided a new pathway to citizenship for 1.8 million Dreamers who came here illegally as children, and would have provided nearly $24 billion in funding requested by President Trump for a southern border wall. The bill would have limited chain migration and eliminated the visa lottery system.

Republican leaders never harbored much hope that the bill would pass, but gave moderates and conservatives an opportunity to vote on legislation after moderates tried to force a vote by pairing up with Democrats on a discharge petition.

While a number of factors kept the bill from passing, the failure stems mostly from difference between GOP moderates and conservatives on how to legalize Dreamers and reform immigration programs.

Conservatives mostly support a bill authored by House Judiciary Committee Chairman Bob Goodlatte, R-Va., that won 193 GOP votes last week. The bill included a narrower legalization for Dreamers, an end to chain migration and the visa lottery system, mandatory E-Verify, and withholding federal funding from sanctuary cities.

Conservatives told the Washington Examiner they also opposed a provision in the Ryan compromise bill that would have provided a pathway to citizenship for the parents who brought Dreamers into the country illegally.

Conservatives said President Trump’s ambiguity about the legislation was a less important but still relevant factor. Trump did not strongly advocate for the compromise bill and at one point tweeted House lawmakers shouldn’t even bother passing a bill because it would be defeated by Senate Democrats, who have the power to filibuster.

Trump made a last-minute appeal on Twitter Wednesday morning in which he urged Republicans to pass the compromise bill. He also said the House should pass the "strong but fair" Goodlatte bill.

But it was too late, even though Goodlatte, the author of the more conservative bill, went to the floor to advocate for the bill, noting the president’s support and arguing it “brings America forward in addressing its immigration issues.”

Rep. Walter Jones, R-N.C., was among the many conservatives who voted against the Ryan bill because of the expanded pathway to citizenship for Dreamers, which nearly doubled the number of young people who would get legal status in the Goodlatte measure that nearly passed a week ago.

“I don’t like the compromise,” Jones said.