The Senate moved closer to passage of comprehensive immigration reform legislation on Wednesday by approving a “border security surge” in a 69-29 vote.

Fifteen Republicans voted for the major amendment, putting the Gang of Eight close to their target of winning 70 votes for final passage. The Senate also defeated a GOP budget point of order that sought to stop the immigration measure.

“This is really America at its best. Each one of those eight senators don’t know, just as I don’t know, whether this work will help them or hurt them in their political careers,” Senate Majority Leader Harry ReidHarry Mason ReidTrump presses GOP to change Senate rules Only thing Defense’s UFO probe proves is power of political favors Nevada Democrat accused of sexual harassment reconsiders retirement: report MORE (D-Nev.) said ahead of the vote. “But we have a broken immigration system, and they have come up with a solution to fix it.”

Crafted by Sens. Bob CorkerRobert (Bob) Phillips CorkerNearly 70 percent say Trump is a bad role model for children: poll PPP poll: Dem leads by 5 points in Tennessee Senate race Dem Iraq War vets renew AUMF push on 15th anniversary of war MORE (R-Tenn.) and John HoevenJohn Henry HoevenTrump’s economic policies spur GOP angst Crop sale incentive program is wrong policy for trade and security Sen. Steve Daines knows the ski slopes, residents MORE (R-N.D.), the border security plan authorizes increasing the number of border patrol agents by 20,000 and constructing 700 miles of fencing. Those border security measures would have to be met within 10 years in order for immigrants to apply for green cards.

The amendment adds $38 billion in security spending to the $8 billion previously included in the bill. At a minimum, it requires the implementation of $4.5 billion worth of technology and equipment to achieve full surveillance of the border.

“Nobody in this body can say that in this amendment we’re voting on today, that we don’t do anything related to border security in this bill,” Corker said.

The Republicans who voted “yes” were Sens. John McCainJohn Sidney McCainZuckerberg: Maybe tech should face some regulations Schiff mocks Trump: Obama, Bush didn't need staff warning 'do not congratulate' Putin GOP senator tears into Trump for congratulating Putin MORE (Ariz.), Lindsey GrahamLindsey Olin GrahamDems aim to turn ObamaCare hikes into election weapon Steyer brings his push to impeach Trump to town halls across the nation Trump formally sends Pompeo nomination to Senate MORE (S.C.), Marco RubioMarco Antonio RubioRussia leak raises questions about staff undermining Trump House members urge Senate to confirm Trump's NASA nominee Rubio: McCabe 'should've been allowed to finish through the weekend' MORE (Fla.), Jeff FlakeJeffrey (Jeff) Lane FlakeNearly 70 percent say Trump is a bad role model for children: poll GOP lawmaker: 'We might need to build a wall between California and Arizona' Steyer brings his push to impeach Trump to town halls across the nation MORE (Ariz.) — the four GOP authors of the underlying legislation — and Sens. Bob Corker (Tenn.), Kelly AyotteKelly Ann AyotteAudit finds US Defense Department wasted hundreds of millions of taxpayer dollars US sends A-10 squadron to Afghanistan for first time in three years No, the US did not spend million on a gas station in Afghanistan MORE (N.H.), Jeff Chiesa (N.J.), Susan CollinsSusan Margaret CollinsCollins: 'Extremely disappointing' ObamaCare fix left out of spending deal Overnight Cybersecurity: Zuckerberg breaks silence on Cambridge Analytica | Senators grill DHS chief on election security | Omnibus to include election cyber funds | Bill would create 'bug bounty' for State GOP lawmakers blast Dems for opposing ObamaCare fix MORE (Maine), Orrin HatchOrrin Grant HatchOmnibus includes search-and-seize provision New kid on the tech block Senate GOP: Legislation to protect Mueller not needed MORE (Utah), Dean HellerDean Arthur HellerRepublican drops Senate primary challenge to Heller after Trump's urging Three states where Dems can pick up Senate seats GOP senator: Justice Kennedy is going to retire this summer MORE (Nev.), Mark KirkMark Steven KirkHigh stakes as Trump heads to Hill Five things to watch for at Trump-Senate GOP meeting Giffords, Scalise highlight party differences on guns MORE (Ill.), John Hoeven (N.D.), Lisa MurkowskiLisa Ann MurkowskiProposed budget for Indian Health Services won't treat Native American patients equally Keep anti-environment riders for Alaska out of spending bill Industry should comply with the Methane Waste Prevention Rule MORE (Alaska), Roger WickerRoger Frederick WickerMiss. governor names state's first female senator to replace retiring Cochran Co-founder of WhatsApp: 'It is time. #deletefacebook' Lawmakers zero in on Zuckerberg MORE (Miss.) and Lamar AlexanderAndrew (Lamar) Lamar AlexanderOvernight Health Care: What to expect in omnibus | HIV expert to head CDC | Sessions issues memo on death penalty for drug cases HIV expert named CDC director GOP lawmakers blast Dems for opposing ObamaCare fix MORE (Tenn.).

Many of the Republicans who voted against the amendment are harshly critical of the overall bill. Sens. Jeff SessionsJefferson (Jeff) Beauregard SessionsHouse Dem moves to force vote on bill protecting Mueller Toobin goes off on Dershowitz for ‘carrying water’ for Trump Overnight Regulation: Groups sue over decision to end pay-data rule | EU proposes tax on tech companies | Sessions issues memo on death penalty for drug cases | Pruitt spent 5K on first class flights MORE (R-Ala.) and Chuck GrassleyCharles (Chuck) Ernest GrassleyGrassley on Trump calling Putin: 'I wouldn't have a conversation with a criminal' Lawmakers zero in on Zuckerberg GOP senator blocking Trump's Intel nominee MORE (R-Iowa) say it repeats to mistakes of the last major immigration reform in 1986 by making border enforcement “promises” and offering “legalization first.”

“It continues false promises of a secured border,” Grassley said Wednesday. “It ought to be enforcement now and legalization later.”

To lure more GOP votes, language from other senators was included in the security amendment. One of the changes to the bill restricts certain nonimmigrant visa holders, such as tourists and foreign students, from accessing Medicaid programs and Affordable Care Act benefits.

Democrats won changes as well. Sen. Bernie SandersBernard (Bernie) SandersModerates see vindication in Lipinski’s primary win Sanders: Fox News 'couldn't handle' town hall on economic inequality Mississippi woman appointed to Senate, making Vermont only state to never have female lawmaker MORE (I-Vt.) secured language to provide $1.5 billion in grants to state workforce investment boards to help young people find jobs over the next two years.

The amendment also includes a provision from Alaska Sens. Mark BegichMark Peter BegichPerez creates advisory team for DNC transition The future of the Arctic 2016’s battle for the Senate: A shifting map MORE (D) and Lisa Murkowski (R) that allows summer workers on J-1 visas to work in fish processing plants in their state. Critics have dubbed it the “Crabhusker kickback.”

The Senate also voted 67-31 Wednesday to end debate on the Senate Judiciary Committee reported substitute amendment to S. 744, setting up a final vote on the measure as early as Thursday.

Managers of the immigration bill are working on a deal to allow a few more amendment votes, setting up a final cloture vote that will happen Thursday on the modified bill. If a deal isn’t reached, final passage will happen Friday instead of Thursday.

Later Wednesday evening, Reid tried to set up votes on 32 amendments — 16 of which were from Republicans — but Grassley objected saying the amendment process had not been as "fair and open" as promised.

"The majority party has offered an agreement that in our view is insufficient," Grassley said. "I feel a bit used and abused in this process for 2.5 weeks we’ve been pushing to get votes on our amendments. We’ve had a measly 10 votes on amendments.

"I’m still willing to negotiate votes, but it will need to be a lot of votes. … In the end we may very well not be having anymore amendment."

The majority leader also said he hopes the House “will follow the Senate’s lead and work to pass bipartisan reform.”

But Grassley said the House would have to rectify the Senate’s “miserable failure.”

“The House of Representatives is going to be the deliberative body on immigration reform and it’s going to put the Senate to shame,” Grassley said.

— This story was updated at 5:18 p.m.