Governor Jerry Brown says he supports the move that will boost immigrant protections in the state.
The California Legislature Saturday passed a "sanctuary state" bill to protect immigrants without legal residency in the US, part of a broader push by Democrats to counter expanded deportation orders under the Trump administration.
The measure, SB-54, passed by a 49-25 vote.
SB 54 would limit state and local law enforcement agencies from communication with federal immigration authorities, and prevent all state and local police forces from questioning and holding people on immigration violations.
McDonnell had broken ranks with many other Los Angeles elected officials by opposing the initial legislation, arguing that if immigration agents could not pick up people from the jails, they would go looking for them in the streets.
But amendments added this week would permit officers to continue sharing information and transferring people for immigration authorities if they have convictions for one or more of roughly 800 crimes. The state has limited the ability of police to detain immigrants for federal deportation agents since 2014, and requires jailers to inform inmates if agents are trying to detain immigrants.
California lawmakers are debating the measure as the U.S. Congress considers offering legal status to young immigrants whose parents brought them into the country illegally or overstayed their visas.
The legislation is the latest effort by Democratic lawmakers in California to create barriers for President Donald Trump's campaign pledge to step up deportation efforts.
A handful of cities including Chicago and San Francisco, meanwhile, are refusing to cooperate with new federal requirements for tougher immigration enforcement, prompting the Trump administration to threaten to withhold funding.
California police chiefs dropped their opposition but sheriffs, who run jails where the biggest impacts will be felt, remain opposed.
Democrats used supermajorities in the state Capitol to pass the bill they viewed as important to highlighting California's stance on shielding its estimated 2.3 million undocumented immigrants from Immigration and Customs Enforcement.
The California Assembly has approved a multi-bill package to address the state's affordable housing crunch. The Republican-controlled body is seeking to bolster federal criminal and immigration law enforcement.
California's Democratic political leaders have positioned the nation's largest state as a foil to Trump and his administration.