Atlanta (CNN) -- A federal judge issued a preliminary injunction Monday temporarily blocking key provisions of a new Georgia law that aims to crack down on illegal immigration, while allowing other parts of the law to move forward.
Most of the law, known as HB 87, was scheduled to go into effect Friday.
U.S. District Judge Thomas Thrash Jr.'s ruling blocks enforcement of two of the most controversial sections of the law.
"State and local law enforcement officers and officials have no authorization to arrest, detain or prosecute anyone based upon sections 7 and 8 of HB 87 while this injunction remains in effect," Thrash ruled.
Those sections would allow police to inquire about immigration status when questioning suspects in certain criminal investigations. They also would punish people who, during the commission of a crime, knowingly transport or harbor illegal immigrants. Something like speeding or driving without proper equipment could constitute a crime.
"The apparent legislative intent is to create such a climate of hostility, fear, mistrust and insecurity that all illegal aliens will leave Georgia," Thrash wrote.
In his 45-page ruling, the judge cited a previous court decision that said preliminary injunctions were in the public interest "when civil rights are at stake." He also wrote that state officials were attempting to overstep federal authority on immigration enforcement.
"I'm very happy, as are all those who believe the Constitution is important," said Charles Kuck, an Atlanta attorney whose firm represented some of the plaintiffs.
He said the stayed provisions were poorly written and that it was unclear how they would have been enforced, if allowed to move forward.
Although the ruling was hailed as a victory by the plaintiffs, Thrash also tossed out a number of their arguments at the state's request, a point stressed by Georgia Attorney General Sam Olens soon after the decision.
"I appreciate the speed with which Judge Thrash ruled, given the complexity of the issues. I am pleased with the dismissal of the 4th Amendment, 14th Amendment, 'Right to Travel,' and Georgia constitutional claims by the plaintiffs -- even after this ruling, 21 of the 23 sections of HB 87 will go into effect as planned," Olens wrote in a statement.
A part of the law that will still go into effect is a provision that workers convicted of using fake identification to get jobs could be sentenced to 15 years in prison and fined $250,000. The law will also require people applying for public benefits to provide certain types of identification.
Olens said his office will appeal the judge's ruling regarding sections 7 and 8.
The office of Georgia Gov. Nathan Deal, which supports the law, also weighed in on the judge's ruling.
"Beyond refusing to help with our state's illegal immigration problem, the federal government is determined to be an obstacle. The state of Georgia narrowly tailored its immigration law to conform with existing federal law and court rulings," said Brian Robinson, the governor's deputy chief of staff for communications. "Georgians can rest assured that this battle doesn't end here."
The Georgia lawsuit is the latest battle in a nationwide skirmish between state and federal officials over who controls immigration enforcement.
Arizona's controversial law aimed at cracking down on illegal immigration catapulted the issue onto the national stage last year, drawing a lawsuit from the U.S. Department of Justice, which argues the law is unconstitutional.
In April, a three-judge panel on the 9th U.S. Circuit Court of Appeals sided with the Justice Department and against Arizona Gov. Jan Brewer, who signed Arizona's law last year. Brewer announced last month that the state would appeal directly to the U.S. Supreme Court.
CNN's Gustavo Valdes and Dana Ford contributed to this report.