WASHINGTON — An immigration debate on Tuesday in the Senate that promised to be freewheeling and democratic got off instead to a rocky start, with Democrats and Republicans in a standoff over how the debate should proceed.

But even as the floor debate faltered, a bipartisan group of senators was working behind the scenes to draft an immigration proposal that could garner the 60 votes necessary to overcome a filibuster.

At stake is the fate of hundreds of thousands of young immigrants brought to the country illegally as children, known as Dreamers, who have been shielded from deportation under an Obama-era program, Deferred Action for Childhood Arrivals, or DACA. President Trump has rescinded the program, which is set to expire March 5, and has given lawmakers until then to come up with a replacement.

Senator Mitch McConnell, the Republican leader, had set aside this week for debate on legislation that would protect the young immigrants, and address other matters including border security and the wall that the president has proposed on the southern border. In an early morning Twitter post on Tuesday, Mr. Trump cast the debate as the Dreamers’ “last chance,” and encouraged the two parties to work together.