A federal judge has temporarily blocked the implementation of the "sanctuary cities" ban Senate Bill 4, a ruling that marks a major victory for opponents of the controversial law that has been a rallying cry for Republican lawmakers across Texas and the nation.

Judge Orlando Garcia’s ruling on Wednesday will hold up the law from taking effect as it was set to do so on Sept. 1. It puts in place a temporary injunction that would require a higher court to overturn in order for the law’s implementation to be put back on track.

Otherwise, SB 4 could remain in purgatory for months until the federal lawsuit clears Garcia’s court.

THE BACK STORY: Austin to sue state over SB 4 ban on ‘sanctuary cities’

Gov. Greg Abbott vowed to appeal the ruling as soon as possible.

"Today’s decision makes Texas’ communities less safe," Abbott said. "Because of this ruling, gang members and dangerous criminals, like those who have been released by the Travis County Sheriff, will be set free to prey upon our communities."

Attorney General Ken Paxton also said his legal fight to defend SB 4 will continue.

"Senate Bill 4 was passed by the Texas Legislature to set a statewide policy of cooperation with federal immigration authorities enforcing our nation’s immigration laws," Paxton said in a news release. "Texas has the sovereign authority and responsibility to protect the safety and welfare of its citizens. We’re confident SB 4 will ultimately be upheld as constitutional and lawful."

SB 4 would have given local law enforcement the power to inquire about a person’s immigration status during routine police interactions with the public, including traffic stops. It also requires local law enforcement to comply with all requests from federal immigration authorities to hold local jail inmates suspected of living in the country illegally and creates civil as well as criminal penalties for elected officials enacting policies against SB 4.

Critics argue that the law encourages racial profiling, frays relations between police and immigrant communities, violates the First and Fourth Amendment and will breakup immigrant families. Proponents say the law will eliminate crime and remove criminals from the streets.

ALSO READ: Advocacy groups brace for implementation of SB 4

Garcia’s ruling bars the state from implementing a provision of the law that would require local law enforcement to comply with so-called detainers federal authorities place on inmates suspected of illegal immigration. Travis County is the only county in Texas with such a policy.

Travis County Sheriff Sally Hernandez had been set to undo a policy that ignored most detainers that Immigration and Customs Enforcement places on inmates at the Travis County Jail. The ruling will allow her policy to remain in place for the time being.

"I am pleased by the court’s ruling today," Hernandez said in an emailed statement. "I believe that local communities are stronger and safer when justice and security are a reality, not for some, but for all. I look forward to the ultimate resolution."

Abbott made SB 4 a top priority of the State Legislature after Hernandez put in the policy on Jan. 20. Abbott said he would "hammer" Travis County, cut $1.5 million from local crime prevention programs and vowed on national television to have Hernandez tossed from office.

Abbott then called for a state law that would dismantle Hernandez’s and prohibit any other local lawmaker from attempting something similar. What state lawmakers delivered was a stricter version of the law with a provision added at the last second giving local cops the ability to inquire about a person’s immigration status based on their own intuition.

COUNTDOWN TO RULING: Austin police, Travis County sheriff prepare to comply with SB 4

As news of the injunction spread, Democrats cheered the ruling.

"This ruling is good for Austin because SB 4 if ever implemented would make Austin less safe," Mayor Steve Adler said in a news release. "This week’s crisis with Hurricane Harvey is just the most recent example why people need to feel safe approaching our local police and support groups, no matter what. If people in Austin do not feel safe asking for help, they become more vulnerable to crime, not just natural disasters."

Council Member Greg Casar said the ruling was a major victory, but that much more lie ahead.

"I think it is a testament to the organizing and advocacy of regular people that this law has been blocked," Council Member Greg Casar said. "I’m grateful."

Rep. Joaquin Castro, D-San Antonio, said he was not surprised by the ruling.

"I’m confident that ultimately, this unjust measure will be deemed unlawful," Castro said in a statement.

State Rep. Eddie Rodriguez, D-Austin, said the ruling allows local law enforcement to concentrate fully on the ongoing rescue and recovery efforts in Hurricane Harvey’s aftermath.

"Thanks to this ruling, we can put an end to the dangerous rumors scaring people away from shelters and preventing them from seeking help," Rodriguez said. Now our first responders can do their jobs and focus on saving lives."

Travis County Judge Sarah Eckhardt said in a news release that Harvey reinforced the need to stop treating immigrants as political pawns or a threat.

"Judge Garcia correctly realized that SB 4 is an unconstitutional ‘solution’ in search of a problem that would ultimately make Travis County and all of Texas less safe," Eckhardt said. "Hopefully this is the first step in consigning SB 4 to the dustbin of history."

Despite the ruling, the legal fight is far from over.

The first suit arose just hours after Abbott signed the bill into law when Paxton sued the city of Austin in a suit that sought to have the law declared constitutional. Austin federal District Court Judge Sam Sparks dismissed that case on Aug. 9.

But within 24 hours, the small border town El Cenizo became the first in what would become a cascade of cities to sue to block the law.

They argue that the law is over broad, violating free speech by possibly disallowing local elected officials from making statements against the law. They have also argued ICE detainers keep inmates in jails illegally because they are not court orders, but rather civil requests.

And, they argue that SB 4 an immigration law that can only be created by lawmakers at Capitol Hill and is preempted by the Constitution.