A US federal judge on Thursday denied a bid by President Donald Trump's administration to block two California "sanctuary" laws that allow the state to limit its cooperation with immigration agents.
US District Judge John Mendez rejected an attempt by the Department of Justice to stop one law that allows California to restrict the type of immigration-related information it shares with federal officials.
He also upheld another law that allows state officials to gain information on federal immigration detention centers in the Golden State.
The judge said that California's decision not to cooperate with the federal government on immigration issues could not be construed as an "obstacle" to enforcement efforts.
"Refusing to help is not the same as impeding," he wrote.
"Standing aside does not equate to standing in the way," he added.
Mendez however did block parts of one of the disputed laws that called for fines against private employers who cooperate with immigration officials.
Reflecting the politically charged environment surrounding immigration, he underlined that his decision was based on legal precedent and "without concern for any possible political consequences."
"This order hopefully will not be viewed through a political lens and this court expresses no views on the soundness of the policies or statutes involved in this lawsuit," the judge said in his 60-page opinion.
"There is no place for politics in our judicial system and this one opinion will neither define nor solve the complicated immigration issues currently facing our nation."
His decision was welcomed by officials in the liberal state, which has spearheaded the battle with the Trump administration over its restrictive immigration policies.
"Today the federal court issued a strong ruling against the federal government's overreach in USA v CA, " California attorney general Xavier Becerra said in a statement. "The Constitution gives the people of California, not the Trump administration, the power to decide how we will provide for our public safety and general welfare."
Federal officials on Thursday praised the judge's ruling related to the workplace but it was unclear whether they would file an appeal concerning the other issues.
"While we are disappointed that California's other laws designed to protect criminal aliens were not yet halted, the Justice Department will continue to seek out and fight unjust policies that threaten public safety," spokesman Devin O'Malley said in a statement.