Brooks’ amendment, which stripped from the NDAA language that was inserted during the Armed Services Committee markup by Rep. Ruben Gallego (D-AZ)—a freshman liberal Democrat who wants to amnesty all the illegal aliens in America—passed the House of Representatives 221-202 on Thursday evening.

“Today is a great victory for Americans and lawful immigrants who wish to serve America in our Armed Forces,” Brooks said in a statement after the vote. “I asked my colleagues to consider how much American families are struggling in an anemic job and wage market and how much the Gallego amendment makes job and income prospects for Americans even worse. It makes no sense to me that, at the same time the Army is downsizing and issuing pink slips to American soldiers serving in Afghanistan, there are Congressmen who seek to help illegal aliens deprive American citizens and lawful immigrants of military service opportunities. I’m pleased the House chose to stand up for American citizens and protect the Constitutional duty of Congress to set immigration law. Today’s vote was the fourth rejection of the President’s unconstitutional DACA program, with Republicans overwhelming standing up for the will of the American people and the citizens and lawful immigrants who want to serve our country.”

Gallego’s amendment would have allowed illegal aliens who have received President Obama’s first executive amnesty—the Deferred Action for Childhood Arrivals (DACA), which some 800,000 or so illegal aliens have received—to enlist in the United States military. It would have come with an NDAA that reduces America’s force size—meaning the NDAA would have, if it weren’t for the Brooks amendment bolstered by conservatives like Reps. Steve King (R-IA) and Dave Brat (R-VA) among others, put illegal aliens ahead of Americans. What’s more, it would have used a defense bill—rather than an immigration bill—to do it.

What’s more, this comes after a rancorous battle in the House Rules Committee this week—where extra attention was drawn to that committee’s chairman Rep. Pete Sessions (R-TX). The process for amendments drew scrutiny too, due to the extraordinarily controversial nature of Gallego’s extreme amendment. Sessions eventually, along with House Armed Services Committee chairman Rep. Mac Thornberry (R-TX), backed Brooks’ amendment—but the only way it got on the bill in the first place was because of a group of Republican members in the Armed Services committee not including Thornberry voting to add it into the bill.

The six Republicans who voted for the Gallego amendment in Armed Services markup are: McSally, MacArthur, LoBiondo, Gibson, Coffman and Rep. Ryan Zinke (R-MT). It’s extremely notable that Zinke did, because when the Brooks amendment came to the floor he turned on the Gallego effort despite being previously supportive of it—ultimately voting for Brooks’ amendment to eliminate the Gallego amnesty text.

Rep. Steve Russell (R-OK), who like Zinke served in the U.S. military and is one of the veterans from this current freshman congressional class, told Breitbart News that the Gallego amendment was unacceptable and jeopardizes national security.

“While I support legal immigrants who are not yet citizens of the United States joining the military and receiving citizenship for their hard work and sacrifice, I find the amendment in the 2016 NDAA to allow DACA, or Dreamers, to enlist in the military to be a more complicated issue,” Russell said. “There are national security concerns that come along with illegal immigrants serving in our military.”

House Minority Leader Nancy Pelosi hammered Republicans for removing the Gallego text as “xenophobic” and “un-American.”

“This is yet another example of anti-immigrant attitude on the part of the House Republicans,” Pelosi said. “This xenophobic, anti-newcomer attitude is something that is un-American.”

House Minority Whip Steny Hoyer similarly bashed Republicans.

“I would hope that our Republican friends would come to their senses,” Hoyer said, adding that he hoped Republicans “would not be blinded by prejudice or a desire to exclude, but be motivated by a desire to recognize the patriotism, and desire to serve, of these young people.”

The effort threatened to derail the entire NDAA bill, which would have been an even more embarrassing episode for House Speaker John Boehner, Majority Leader Kevin McCarthy and Majority Whip Steve Scalise. In fact, the reason why this current leadership team—as listed in the sentence before this one—doesn’t include the name “Eric Cantor” is because of the fact that last year Cantor was part of a secretive effort with Denham and Coffman to try to do exactly what Gallego did in the NDAA. After the effort was exposed, Cantor lost his election—the first time in U.S. history a sitting House Majority Leader was beaten in a primary election—in large part because of the fact that Brat honed in on Cantor’s support for amnesty. This fiasco, if it wasn’t resolved like it was with the Brooks amendment, threatened to jeopardize not just NDAA passage but the re-elections in primaries of Boehner, Scalise and Sessions—and probably more.