SACRAMENTO, Calif. — A U.S. judge urged Congress and the president to set aside partisan differences on immigration in a ruling that allowed California to enforce some state sanctuary laws but warned that "piecemeal" court decisions were not a long-term solution to the nation's heated immigration debate.
The ruling came Thursday in a lawsuit filed against the state by the Trump administration and continued a pattern of judicial decision-making on key immigration disputes as Democrats and Republicans turn to courts to fight policies.
Judges in recent months have also ruled on the Trump administration's push for a border wall with Mexico and its move to revoke an Obama-era program protecting young immigrants from deportation.
Judge John Mendez ruled Thursday that California could limit police cooperation with immigration officials and require inspections of detention facilities but could not enforce a key part of a third state sanctuary law barring private employers from allowing immigration officials on their premises without a warrant.
In his unusually impassioned opinion, Mendez also urged elected officials to "set aside the partisan and polarizing politics dominating the current immigration debate and work in a cooperative and bi-partisan fashion toward drafting and passing legislation that addresses" the "critical" immigration issue.
"Our nation deserves it. Our Constitution demands it," Mendez said in the opinion dated July 4 and filed Thursday.
Mendez was nominated to the bench by Republican George W. Bush.
California's Democratic Gov. Jerry Brown agreed with the judge. Brown previously said the administration's lawsuit against the state was akin to the U.S. "going to war" against California.
"Only Congress can chart the path forward by rising above mindless, partisan divisions and working together to solve this problem, not exacerbate it," Brown said.
Mendez's ruling on the California laws allowed both sides to claim victory.
"Today the federal court issued a strong ruling against federal government overreach," 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."
The U.S. Department of Justice said it was disappointed that two of the laws were "not yet halted," but it called the ruling on the third law a "major victory for private employers in California who are no longer prevented from cooperating with legitimate enforcement of our nation's immigration laws."
The agency "will continue to seek out and fight unjust policies that threaten public safety," DOJ spokesman Devin O'Malley said in a statement.
The administration filed suit in March to block the laws, continuing its efforts to crackdown on so-called sanctuary jurisdictions that it says allow criminals to stay on the streets.
California has resisted the administration's effort to restrict funding to sanctuary jurisdictions if they refuse to help federal agents detain and deport immigrants. Overall, the state has sued the administration more than 50 times, mostly over immigration and environmental decisions.
The lawsuit considered by Mendez argued that the U.S. Constitution gives the federal government pre-eminent power to regulate immigration, and California can't obstruct enforcement efforts.
California said in court documents that the administration was trying to assume powers that have long been understood to belong to states and could not show that California's policies were causing harm.
Passage of the three laws followed President Donald Trump's promises to ramp up deportations.
Mendez said in Thursday's ruling that the federal government's request for a preliminary injunction presented "unique and novel constitutional issues."
"Deciding these critical issues requires this court to determine the proper balance between the twin powers of California and the United States," he wrote.
The law requiring inspections of detention facilities where immigrants are held did not "impose any substantive requirements upon detention facilities," the judge said.
"For all its bark, the law has no real bite," he wrote.
The measure preventing law enforcement from providing release dates and personal information of jail inmates — information administration officials say they need to safely remove dangerous people who are in the country illegally — is not an obstacle to federal immigration enforcement efforts, Mendez said.
The judge said "refusing to help is not the same as impeding."
But subjecting employers to monetary penalties solely because they allow immigration agents into their places of business or give them access to employment records discriminates against those who choose to deal with the federal government, the judge said.
Mendez also blocked another part of that law that prohibited employers from checking whether existing employees are authorized to work in the U.S. He left in place, however, a provision requiring employers to notify workers within 72 hours of receiving a notice of inspection from an immigration enforcement agency.
The state had asked Mendez to dismiss the lawsuit. The judge did not immediately rule on that request.