The Senate on Tuesday rejected a proposal that would have withheld permanent legal status for most undocumented immigrants until the completion of 700 miles of double-layered border fence.

The amendment to the bipartisan immigration reform bill proposed by Republican Sen. John Thune (S.D.) failed by a vote of 39-54. Sixty yes votes were needed to pass. The language also would have prevented most undocumented immigrants from seeking temporary legal status until 350 miles of that fencing was built.

The amendment's defeat represents another setback for conservative lawmakers who say that the Gang of Eight bill doesn't go far enough to secure the U.S.-Mexico border.

But it's a victory for sponsors of the bill in both parties. They say their bill contains the strongest border protection measures in American history.

Members of the Gang of Eight, which authored the bill, have said that several GOP amendments go too far in making the path to citizenship conditional on sweeping border security projects.

The Senate bill already contains so-called "triggers" that must be met before legalized immigrants can obtain green cards that grant them permanent status. Under the existing bill, $1.5 billion is allocated toward a fencing strategy for the Southern border that includes construction of double-layered fencing in some areas and monitoring technology elsewhere. The plan must be "substantially completed" before legalized immigrants can acquire green cards.

Sen. John McCain (R-Ariz.), an author of the bill, urged senators to vote no on the Thune fence amendment.

"Fencing is important," he said on Tuesday. "Surveillance is more important."

Supporters of the border fence effort note that Congress required the completion of 700 miles of fencing in 2006. But Congress altered the law the next year to give the federal government discretion over what types of barriers were necessary to construct in different areas. Close to 350 miles of fencing currently stands along the U.S.-Mexico border, while 299 miles is covered by vehicle barriers.

Senators also voted down an amendment by Sen. David Vitter (R-La.) that would require a full biometric visa tracking system to be put in place at every land, sea and air port of entry in the U.S. before legalized immigrants could get green cards.

The Gang of Eight bill requires that all non-U.S. citizens be fingerprinted when leaving the country through the nation's 30 busiest airports. Sen. Lindsey Graham (S.C.), a Republican author of the bill, previously called a full biometric program too costly.

"I want biometrics as far as the eye can see, in as many ways as possible, post-9/11, to protect this nation," he said last month, according to NPR. "But to make it a trigger in light of how much it costs and how long it takes, I just think goes too far."

The Senate unanimously adopted a technical amendment related to international adoptees proposed by Sen. Mary Landrieu (D-La.). It also passed an amendment from Sen. Jon Tester (D-Mont.) that would include Native American tribal officials on a border security advisory panel.