Continued from page 1

“It’s historic,” said Mr. Reid, who is one of the chief reasons the legislation has advanced this year.

It was Mr. Reid’s re-election in 2010 and Mr. Obama’s re-election in 2012 — both aided by strong Hispanic support — that helped put immigration back to the fore of the political conversation.

Since Mr. Obama’s November victory, congressional Republicans have held a fierce internal debate over whether they need to pass a legalization bill in order to compete for Hispanic voters.

The crux of the Senate bill is a deal to offer quick legal status to illegal immigrants, but withhold full citizenship rights until some conditions are met. Backers said they didn’t want to repeat the experience of the 1986 immigration law, when millions of illegal immigrants were granted citizenship but the government never followed through on enforcement, leading to millions more illegal immigrants.

This time, they said, they would tie future citizenship rights to checking off boxes on border security.

But the key point of contention has been over how strict to make those conditions. Democrats have said they don’t want to do anything that would interfere with the path to citizenship, and they have succeeded in beating back amendments to make the citizenship path contingent on provable success. Instead, the Senate bill relies on measures of spending and having infrastructure and manpower in place.

The one major amendment that passed, proposed by Republican Sens. Bob Corker of Tennessee and John Hoeven of North Dakota, called for adding 20,000 Border Patrol agents to the Southwest and would push the Homeland Security Department to build an additional 350 miles of pedestrian fencing.

Mr. McCain said the staffing, infrastructure and technology are the guarantees he needs to be certain the failures of 1986 aren’t repeated.

“I can tell you from 30 years of being on the border, this bill secures the border, and anyone who says it doesn’t does not understand our security needs,” the senator said.

But the National Border Patrol Council, which represents Border Patrol agents, said it had “serious concerns” about the boost in staffing.

“Unless we’re going to form a human chain from Brownsville to Imperial Beach, I’m not sure this is going to be the cure that everybody thinks it will be at the border,” said Shawn Moran, a vice president at the council. “We don’t have money for gas or ammunition or uniforms, and that’s at 21,000 agents. I’m not sure how we’re going to be able to handle 40,000 agents. I don’t know where we’re going to put them.”

The council had a different proposal to reform agents’ pay, which Mr. Moran said would have put more agents into the field and would have been the equivalent of a 5,000-agent boost over the course of a year. But that proposal got held up along with the hundreds of other amendments that never were put to a vote.

In addition to Mr. McCain, Mr. Corker, Mr. Graham and Mr. Hoeven, the Republicans supporting the legislation were Sens. Lamar Alexander of Tennessee, Kelly Ayotte of New Hampshire, Jeff Chiesa of New Jersey, Susan M. Collins of Maine, Jeff Flake of Arizona, Orrin G. Hatch of Utah, Mark Kirk of Illinois, Lisa Murkowski of Alaska and Marco Rubio of Florida.