Now the Senate has a new immigration deadline: Feb. 8, the date that a stopgap spending measure approved on Monday will expire. Mr. McConnell has said that if the fate of the young undocumented immigrants is not resolved by then, he will allow the floor debate on immigration.

“What came out of this mess was a date certain to move on immigration,” said Senator Lindsey Graham, Republican of South Carolina, a longtime advocate of an immigration overhaul who has been deeply involved in the bipartisan talks. “That’s positive. Whether you’re a Democrat or a Republican, we’re now moving on immigration. That wouldn’t have happened without this conflict.”

But hard-liners on immigration were not budging.

“I think the top priority for Senate Democrats is amnesty for people here illegally,” said Senator Ted Cruz, Republican of Texas. “They just shut the government down over amnesty, and so I don’t think Senator Schumer and Senate Democrats are interested in securing the border.”

Such voices would dominate debate in the House, where twice, in the Obama and George W. Bush presidencies, bipartisan comprehensive overhauls of the nation’s immigration laws have died. But senators, given the green light by their leaders, pressed ahead.

If nothing else, passage of a bipartisan immigration bill in the Senate would shift the political focus to the House, where the bulk of the 2018 election will be fought.

As lawmakers are racing to a conclusion, so are the courts. After a federal judge ruled that Mr. Trump could not summarily end the DACA program, the Justice Department appealed to the Supreme Court. The Supreme Court said Tuesday that it would consider the case on an expedited basis, and ordered both sides to submit briefs by Feb. 2.