AUSTIN (Nexstar) — The Texas House early Wednesday morning passed a provision to establish the state’s own border patrol force after Democrats came close to killing the measure on a procedural objection.

House Bill 20 by Tyler Republican Matt Schaefer would have created the “Border Protection Unit” as a new agency under the Texas Department of Public Safety. Officers in that unit would have the authority to arrest unlawful border crossers, build border barriers, search vehicles, use force against cartels and more. Their jurisdiction would extend not just to border areas, but to every part of the state.

Dallas Democrat Rafael Anchia made a parliamentary move to block the bill during a late-night session Tuesday in the Texas House. His point of order was sustained, but a modified version of its provisions prevailed as an amendment to another border bill.

Rio Grande City Republican Ryan Guillen amended his House Bill 7 to include a new version of the Border Protection Unit.

The amended legislation allows only licensed peace officers to serve in the unit and limits the unit’s authority to what is granted by the commissioners of the county in which they operate. It passed on a 90-51 vote.

“Our limited law enforcement personnel cannot effectively address fentanyl smuggling across our border when they’re spending their time processing people,” Schaefer said Tuesday afternoon. “We have to restore order to the Texas border. House Bill 20 will invoke legal authorities in the United States Constitution which allow a state to defend itself when poison is being pumped into our neighborhoods.”

His bill asserted that drug and human smuggling on the southern border allows the state to keep troops and engage in war under the “invasions clause” of the U.S. Constitution.

Article 1, Section 10 of the Constitution forbids states from keeping troops, entering into compacts with other states or countries, and engaging in war “unless actually invaded, or in such imminent danger as will not admit of delay.”

Under current Supreme Court precedent, states may not legislate immigration law where otherwise legislated by the federal government. Legal scholars note House Bill 20 is unconstitutional under that standard and will likely invite a court challenge.

“This bill is constitutional,” Schaefer said. “I believe that certainly there are those people that disagree, but we’re gonna move forward with the passage of the bill. And people have a right to sue if they want to. But we believe that this bill is constitutional.”

Some supporters of the Border Protection Unit hope it will force a change to that precedent by challenging Arizona v. US, the 2012 Supreme Court case which asserted the federal government’s preemption of immigration law.

“I sincerely hope that we do land in a court of ‘Texas v. U.S.,’ and revisit that issue,” Executive Director of the Texas Sheriffs’ Regional Alliance AJ Louderback said. “We must strive to solve this the border issue. And I believe the real route to this is ‘Texas v. U.S’ and getting that before the Supreme Court where we make and restore some state rights as border state, which carries the brunt of this problem.”

Texans from the Rio Grande Valley traveled to the state capitol on Tuesday to protest the bill, worrying the new law enforcement agency could lead to over-militarization and discrimination in their communities.

“We need to find another solution that’s not going to militarize our border even more,” the Director of Organizing at La Unión del Pueblo Entero said. “Operation Lone Star is costing more than $4 billion, and people are still crossing. That’s just not the solution. And we need to invest those funds in creating other means for these people to be able to seek shelter or refuge in a humane and dignified way.”

A few dozen activists chanted outside the House chambers Tuesday morning before confronting the office of State Rep. Ryan Guillen, R-Rio Grande City. Guillen is carrying House Bill 7– another bill to expand state power on the border. Guillen’s staff locked his office when protesters attempted to enter.

“We have not made any progress with our representatives. In fact, last week, we had a protest outside Ryan Guillen’s office in Rio Grande City. And unfortunately, they pretty much locked the office door,” Garcia said. “But we did leave a letter on behalf of the over one thousand members down in the Rio Grande Valley, telling him that we oppose HB 20 and HB 7 and that other communities do not need more militarization… So we’re gonna be here today and make sure that they know that the border residents oppose these two bills.”