A bill that would outlaw “sanctuary” jurisdictions in Texas cleared its last procedural hurdle in the Texas House Thursday afternoon, just hours after the end of a marathon debate on the state-based immigration measure that stretched into Thursday morning.

The bill passed on a party-line vote, 94 to 53.

The legislation, Senate Bill 4, makes sheriffs, constables, police chiefs and local leaders subject to a Class A misdemeanor if they don’t cooperate with federal authorities and honor requests from immigration agents to hold noncitizen inmates subject to deportation. It also provides civil penalties for entities in violation of the provision that begin at $1,000 for a first offense and climb to as high as $25,500 for each subsequent infraction.

Before the final vote, Democrats were still visibly upset after they unsuccessfully fought Wednesday against an amendment by Tyler Republican Matt Schaefer that made the House version of the bill more punitive.

The amendment allows police officers to question a person’s immigration status during a detainment, as opposed to being limited to a lawful arrest. Democrats and immigrant rights groups argue this makes the bill "show-me-your-papers"-type legislation where police will be able to inquire into status during the most routine exchanges, including traffic stops.

The amendment was added after the House stood at ease for nearly two hours as lawmakers from both sides of the aisle tried to hammer out a deal whereby the measure wouldn’t be tacked on.

Schaefer said Thursday morning that Democrats were given plenty of time to agree to a compromise where he would pull his amendment if Democrats limited the number of amendments they would debate.

Schaefer also requested that a separate measure by Irving Republican Matt Rinaldi, which would allow an elected official to be removed from office through a civil procedure if they violated the provisions of the bill, stay on the bill. Both measures ended up being tacked onto the bill despite unanimous Democratic opposition.

“There was a point in the afternoon where we began some discussions about a deal to end what is the equivalent of a filibuster,” he said. “But it didn’t work out. That option was open to them for several hours.”

State Rep. Chris Turner, a Grand Prairie Democrat and chairman of the Democratic Caucus, disputed Schaefer’s characterization.

“There was a framework for that type of agreement, [and] we were discussing it,” he said. “Then the Republicans came in and said the deal was off. They had changed the terms of the deal. That ended the discussion.”

The bill now goes back to the upper chamber, where senators have the option to accept the changes the House made or call for a conference committee in which members from both chambers iron out the differences.

Since the detainment language was already included in the version of the bill that passed the Senate, senators could also accept the House's version of the bill and send it to Gov. Greg Abbott’s desk.

"Governor Abbott applauds the Texas House for voting to ban sanctuary cities, and he looks forward to signing the final bill into law," Abbott spokesman John Wittman said in a statement Thursday.

Turner said Republicans shoulder the full burden for passing out the controversial measure, despite Schaefer's claims that Democrats had the opportunity to keep out some of the most controversial language.

“Senate Bill 4 is a bill authored by Republicans, put on the House floor by Republicans, passed solely with Republican votes,” he said. “The Republicans own this lock, stock and barrel. They control this place, and Democrats fought as hard as we knew how for 16 hours.”

Thursday's final vote came as Democrats, defeated and downtrodden, promised Republicans they'd eventually regret their votes.

"If your goal was to use immigrants for political gain, you have succeeded. If your goal was to strike terror into the hearts of immigrants so they go home, you have succeeded," said state Rep. Rafael Anchia, D-Dallas. "I hope you’re satisfied."

Added El Paso Democrat Rep. Mary González: "A lot of you know I am angry, and I am not sure how I get over it. But I have every right to be angry when people's lives are being dramatically impacted. I hope today you go home and you think, 'What am I doing here? Am I being a person of integrity?'"

Patrick Svitek contributed to this report.