The lawsuit argued that the U.S. Constitution gives the federal government pre-eminent power to regulate immigration, and California can't obstruct immigration enforcement efforts.
Mendez wrote that the laws -- including "sanctuary state" law SB 54 and AB 103, which requires state inspections of immigrant detention facilities -- "are permissible exercises of California's sovereign power." He wrote that AB 450's restrictions on private employers "impermissibly infringed on the sovereignty of the United States."
California officials say their policies promote trust between immigrant communities and law enforcement. The administration says the state is allowing dangerous criminals to stay on the street.
"California is under no obligation to assist Trump to tear apart families," SB 54 author Sen. Kevin de León, D-Los Angeles, said after the ruling. "We cannot stop his mean-spirited immigration policies, but we do not have to lift a single finger or spend a single cent to be a cog in the Trump deportation machine."
“When they passed SB 54, AB 103, and AB 450, California’s political leadership clearly intended to obstruct federal immigration authorities in their state," U.S. Department of Justice spokesman Devin O'Malley said in a written statement, which called the injunction related to employers a "major victory."
"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," O'Malley's statement continued.
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.
State Assemblyman David Chiu, D-San Francisco and author of the employer-related law AB 450, called Thursday's ruling "a rebuke to the racist immigration policies of President Trump and U.S. Attorney General Jeff Sessions."
"While I’m disappointed that portions of the law were put on hold, nothing stops employers who care about their immigrant employees from voluntarily asking ICE agents for judicial warrants," Chiu said in a written statement. "It is up to all of us, in our individual ways, to resist the war on immigrants in the United States."
Mendez said during a hearing in June that he wasn't convinced California intended to interfere with federal immigration enforcement.
The three laws, two of which went into effect in January, follow President Trump's promises to ramp up deportations. The administration has tried to restrict funding to sanctuary jurisdictions if they refuse to help federal agents detain and deport immigrants.
California, which this year became the second "sanctuary state," has resisted that move. It has filed more than 50 lawsuits against the Trump administration, mostly over immigration and environmental decisions, and notched some significant court victories.
The state asked Mendez to dismiss the Trump administration's lawsuit, which Democratic Gov. Jerry Brown has described as akin to "going to war."
Mendez concluded his opinion with a plea for legislative action on U.S. immigration policy, noting that an ultimate solution "cannot and will not come from piecemeal opinions issued by the judicial branch."
"Accordingly, this Court joins the ever-growing chorus of Federal Judges in urging our 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 this critical political issue," Mendez wrote. "Our Nation deserves it. Our Constitution demands it."
Thursday's ruling was the judge's answer to a request for a preliminary injunction, and Mendez largely rejected the attempt to strike down California's laws at this stage of the litigation. The Trump administration's challenges to the laws will continue as the case proceeds.
Read the ruling here.
Scott Shafer, Alex Emslie and Guy Marzorati of KQED News contributed to this report.