Continued from page 1

At one point, Mr. Cornyn mocked Mr. McCain, Arizona Republican, for flip-flopping on adding border agents and fencing.

On Wednesday, Mr. McCain blasted Mr. Cornyn’s proposal to build fencing and add 5,000 agents, saying it was too expensive and that those decisions should be left to the Homeland Security Department. But on Thursday, Mr. McCain embraced the Hoeven-Corker proposal.

“Now I find to my shock and amazement the distinguished senior senator from Arizona saying we need 20,000 more Border Patrol,” Mr. Cornyn said.

Mr. McCain replied that his state has taken the brunt of illegal immigration and drug-smuggling, and he is eager for a solution that will work.

“I take a back seat to no one, even from the great state of Texas,” he said.

Mr. Cornyn’s own border security amendment, which would have prevented illegal immigrants from getting green cards until the government was successfully preventing or turning back 90 percent of illegal crossers, was defeated on a 54-43 vote earlier in the day.

Still, that vote fractured the Gang of Eight as Sen. Marco Rubio, Florida Republican and the man expected to sell the immigration deal to conservatives, voted with Mr. Cornyn.

The CBO report that lawmakers said cleared the budget space for them to boost border security also warned that the bill as written would cut future illegal immigration by only 25 percent, meaning millions more illegal immigrants over the next decade.

The CBO said that rather than cross the border, those illegal immigrants are likely to have come legally as guest workers — which are boosted under the bill — and then stay after their work period has expired.