Republicans in Congress who have spent months demanding that any aid to Ukraine be paired with a crackdown against migration into the United States got what they asked for when a bipartisan group of senators released a $118.3 billion agreement that would provide both.

On Monday, many of them rejected it anyway.

It was the latest indication that the political ground for any agreement on immigration — particularly in an election year when it is expected to be a central issue of the presidential campaign — has vanished.

With former President Donald J. Trump eager to attack President Biden’s record on the border and right-wing Republicans in Congress falling in line behind him, a compromise was always going to be a long shot. The long-awaited release on Sunday night of the text of the 370-page bill only served to inflame Republican divisions on an issue that once united them.

Even as Senator Mitch McConnell of Kentucky, the minority leader and a champion of funding for Ukraine, took to the floor to push for action on the bill, many of his fellow Republican leaders were savaging it. Speaker Mike Johnson denounced the measure as “even worse than we expected” and, in a joint statement with his leadership team, repeated what had become his mantra about the deal — that it would be “dead on arrival” in the House.

Even more temperate Republican voices like Senator John Cornyn of Texas, who had encouraged the negotiations, said that after reviewing it, he harbored “serious concerns.” (Mr. Cornyn, who is often mentioned as a potential successor to Mr. McConnell as the Republican leader, notably gave the statement to the hard-right news outlet Breitbart.)

By Monday evening, Mr. McConnell was privately acknowledging that the measure had hemorrhaged support among Republicans, and recommending they move to block it unless Democrats agreed to debate it further and allow them to propose changes.