Editor's note: This story has been updated throughout.

A panel of three 5th U.S. Circuit Court of Appeals judges ruled Tuesday that most of the state’s immigration enforcement legislation, Senate Bill 4, can remain in effect while the case plays out, handing a victory to Gov. Greg Abbott and Republican supporters of the law.

As passed, Senate Bill 4 allows local law enforcement officers to question the immigration status of people they detain or arrest and punishes local government department heads and elected officials who don’t cooperate with federal immigration "detainers" — requests by agents to turn over immigrants subject to possible deportation — in the form of jail time and penalties that exceed $25,000.

The one part of SB 4 that is still on hold is a provision that punishes local officials for “adopting, enforcing or endorsing” policies that specifically prohibit or limit enforcement of immigration laws. The judges kept that injunction in place, but said it only applies to the word “endorse.” The bill, as passed and signed, would have made elected and appointed officials subject to a fine, jail time and possible removal from office for violating all or parts of the legislation.

The American Civil Liberties Union of Texas, which represents some of the plaintiffs in the SB 4 case, said it was considering how to move forward.

"The court made clear that we remain free to challenge the manner in which the law is implemented, so we will be monitoring the situation on the ground closely," said Lee Gelernt, deputy director of the ACLU’s Immigrants’ Rights Project.

The law, one of the most controversial in recent Texas Legislature history, came after Abbott declared the legislation a priority item early during last year’s 85th legislative session. After the governor signed the bill during a Facebook Live event in May, the city of El Cenizo and Maverick County sued to stop the law and were joined by several local governments, including the cities of Houston, Austin and San Antonio as well as El Paso County. The Mexican American Legal Defense and Educational Fund, or MALDEF, and the ACLU represented several of the clients.

Thomas A. Saenz, president and general counsel of MALDEF, said in a Tuesday night statement that "the battle against SB 4 is far from over."

"After consulting its clients, MALDEF will pursue the most appropriate legal course to continue to challenge and restrict SB 4," Saenz said. "We remain confident that this horrific law will ultimately find its rightful place in the dustbin of history."

In August, U.S. District Judge Orlando Garcia halted several parts of the bill, including the provision that requires jail officials to honor all detainers. He also blocked sections that prohibit local entities from pursuing “a pattern or practice that 'materially limits' the enforcement of immigration laws” and another that prohibits “assisting or cooperating” with federal immigration officers as reasonable or necessary.

But he did not halt the part of the bill that says police chiefs, sheriffs and other department heads cannot forbid officers from questioning a person’s immigration status, which means that Texas has been what opponents of the measure call a “papers please” state since the law took effect.

A separate panel of judges ruled in September that the detainer provision could stand until a final determination was made. The panel also stated that law enforcement officers, including campus police, with “authority that may impact immigration” cannot be prevented from assisting federal immigration officers. In their decision on Tuesday, the judges recommended the case go back to the district court level “with instructions to dismiss the vacated injunction provisions.”

After Tuesday's ruling was announced, Abbott updated his followers on Twitter, highlighting that claims the bill would lead to racial profiling were rejected.

"Texas Ban on Sanctuary City Policies upheld by Federal Court of Appeals," he tweeted. "Allegations of discrimination were rejected. Law is in effect."

Texas Attorney General Ken Paxton also praised the ruling, saying in a statement that SB 4 is constitutional and protects the safety of law enforcement officers and all Texans.

“Enforcing immigration law prevents the release of individuals from custody who have been charged with serious crimes," he said. "Dangerous criminals shouldn’t be allowed back into our communities to possibly commit more crimes.”