WASHINGTON – A bipartisan group of senators agreed Thursday on a strengthened border-security plan in an effort to draw Republican support for the most significant revision of U.S. immigration law in a generation.

The plan, described on the Senate floor by Republican senators Bob Corker of Tennessee and John Hoeven of North Dakota, would double the U.S. Border Patrol’s size by adding 20,000 agents and would require 700 miles of fencing at the U.S.-Mexico border. It would provide additional unmanned aerial drones to help police the border.

“It’s solved the riddle of how we deal with border security,” said Sen. Charles Schumer, D-N.Y., and a Democratic co-sponsor of the bill. “I think it’s a breakthrough, and I’m optimistic it can help us get a large number of votes on both sides of the aisle.”

The Senate is in its second week of debate on immigration legislation that seeks to balance Democrats’ goal of a path to citizenship for about 11 million undocumented immigrants in the U.S. with Republicans’ demand for stricter border security. Senate Democratic leaders want to pass a bill before July 4. The last major revision of immigration law was in 1986.

South Carolina Sen. Lindsey Graham, a Republican co-sponsor of the bill, said the bipartisan proposal would require the Department of Homeland Security to certify that the additional border-security resources were in place before undocumented immigrants could receive permanent legal status.

All employers would have to be using an E-verify system to check workers’ legal status, and all airports and seaports would have to use a visa entry and exit system.

“We believe all of this can be done in 10 years,” Graham told reporters. In that case, it wouldn’t delay the Senate bill’s plan to allow undocumented immigrants to begin receiving permanent legal status in 10 years.

The compromise drew praise from Sen. Marco Rubio of Florida, a Republican co-sponsor of the Senate bill who had previously said he wouldn’t support it without more stringent border control.

“What this amendment reflects is what we know will work,” Rubio said on the Senate floor. “We know that adding border patrol agents, doubling the size of the border force, will work.”

Arizona Sen. John McCain, another Republican co-sponsor, said the provision “addresses the concerns of many Republicans.” He said a “significant” number of Republicans, including all four in the bipartisan negotiating group, agreed to support the plan.

Corker said the proposal “brings on at least 15 Republicans, and I think momentum is building.”

Earlier Thursday, the Senate defeated a border-security proposal by Texas Republican John Cornyn that Democrats and some Republicans said would have scuttled bipartisan support for the legislation. His plan, rejected 54-43, would have required the government to show it was apprehending 90 percent of the people illegally crossing the border from Mexico before undocumented immigrants could gain permanent legal residency. Cornyn said on the Senate floor that he was reserving judgment on today’s bipartisan proposal until he could review the details. Still, he said doubling the number of border-security agents would improve the bill.

“That’s a substantial movement in terms of boots on the ground,” he said. “I’m looking forward to seeing the language that’s being proposed.”

Still, Republicans Charles Grassley of Iowa, Jeff Sessions of Alabama, Ted Cruz of Texas, David Vitter of Louisiana and Mike Lee of Utah said the compromise proposal wouldn’t do enough to ensure the border is secure.

Vitter told reporters that the compromise amendment was designed “to pass the bill, not to fix the bill.”

“I think this is an attempt to pull out of the fire a bill that has been weakening,” Sessions said.

As originally proposed, the Senate immigration bill, S. 744, would allow undocumented immigrants to gain permanent residency, known as a green card, when the government has a “substantially operational” plan for achieving a 90 percent apprehension rate at the border.

Sen. Mark Kirk, R-Ill., said “This bipartisan compromise will restore the people’s trust in our ability to control the border.