The House on Thursday defeated a Republican immigration reform bill in the first of two doomed votes that some had hoped would pave the way to stronger border security and a pathway to citizenship for "Dreamers" caught in legal limbo.

Lawmakers voted against a measure authored by House Judiciary Committee Chairman Bob Goodlatte, R-Va., and Homeland Security Committee Chairman Michael McCaul, R-Texas, that is considered the more conservative of the two options considered on Thursday.

The House rejected that bill 193-231, in a vote that saw 41 Republicans go against their GOP colleagues. Every Democrat voted against it.

And in another sign that Republicans were struggling to find votes in their own party, GOP leaders decided to delay a vote on the second bill from House Speaker Paul Ryan, R-Wis., until Friday. The hope is that leaders can convince more Republicans to support that version, but it's not clear it can pass this week.

The Goodlatte measure would have provided a nonspecialized pathway to citizenship for about 700,000 young people who registered for an Obama-era program that allowed them to temporarily stay in the United States.

It would have reduced legal immigration and replaced the diversity visa lottery system with a merit based system. It also would have ended chain migration program, required employers to use E-Verify, established a program for immigrant agriculture workers, and authorized funding for a southern border wall and other border security improvements.

“Border security is a national security issue,” McCaul said as he cited the terrorists and illegal drugs that get through U.S. borders. “We must solve this problem and we must solve it today.”

The measure would withhold federal funding for "sanctuary cities" that shield illegal immigrants from federal immigration officials, and end a policy of “catch and release” at the border that has enabled hundreds of thousands of illegal immigrants to evade deportation. It would change illegal immigration from a civil offense to a criminal offense.

The debate on the bill took place as the Trump administration grappled with backlash against the holding of illegal immigrant adults in detention while their children are detained elsewhere.

Trump’s wavering stance on border separation caused confusion on the House floor. As lawmakers debated the measure, reports emerged that the Trump administration had stopped detaining adult illegal immigrants with children at the border, but then the Department of Justice denied the report.

“Your president has left you out on a limb and he just sawed that limb off,” said Rep. Zoe Lofgren, D-Calif., when the report first came out. “This bill is a step in the wrong direction in so many ways."

Goodlatte said the bill would fix the confusion at the border and end the “open border policy” of just letting illegal immigrants go free.

“I see the conflicting news reports but that does not change the fact that it has nothing to do with the good measures in this bill that correct the problems we are speaking about,” Goodlatte said.