For nearly two decades, Alameda County sheriff’s Sgt. Don Laventure has kept inmate records at what was once one of the nation’s largest jails, a campus of low cement buildings set among seasonally green hills. He knows his work.

Yet since January, a flowchart drawn in green highlighter has hung over the window above his desk at Santa Rita Jail. It is a cheat sheet for how to follow the rules imposed by California’s “sanctuary state” law, which providesbroad legal protection from federal deportation to the state’s estimated 2.5 million undocumented immigrants.

Students run as part of their training at the Deputy Sheriffs Activities League boxing gym in Hayward, Calif. (Salwan Georges/The Washington Post)

The chart is a collection of arrows, some pointing sideways, some down, some toward U.S. Immigration and Customs Enforcement — and even more pointing away from it.

California’s new sanctuary-state law has made Laventure’s job more complex, but for many public-safety officials in the state, their frustration is about more than the cumbersome rules. The law, they say, is putting people at risk.

Growing opposition to the law is challenging California’s identity as the heart of liberal resistance to the Trump administration. Protestsfrom conservative residents and politicians are emerging in courthouses and council meetings from here in the Bay Area to San Diego County.

Known officially as the California Values Act, the law prohibits nearly all communication between local law enforcement officials and federal immigration agents.At Santa Rita Jail, which takes in between 400 and 500 people a day, 35 inmates have been met by ICE agents so far this year — a number that the jail’s commander believes should be far higher.

“We constantly have to second-guess ourselves,” said Capt. Derrick Hesselein, commander of the jail.

There are exceptions to the law for when ICE requests information about undocumented inmates with serious criminal pasts. But those legal thresholds are high, which the measure’s supporters say are necessary to prevent undocumented immigrants who do not pose a public-safety threat from being swept up in deportations.

A deputy checks on inmates at Santa Rita Jail on April 5 in Dublin, Calif. The Alameda County jail has a complicated set of rules established by the state for working with U.S. Immigration and Customs Enforcement. (Salwan Georges/The Washington Post)

In recent weeks, more than a dozen small cities and three counties in California have joined the Trump administration’s lawsuit challenging the constitutionality of the sanctuary-state law. There is a sense among conservatives facing a difficult midterm election season that California has become “a rogue state,” in the words of a San Diego County supervisor who voted to join the federal lawsuit last month.

“Bringing up immigration is a way of mobilizing moderate, traditional Republicans here without bringing up Trump, who is not particularly popular,” said Louis DeSipio, a political-science professor at the University of California at Irvine. “At the grass-roots level, there may be opposition to this law and fear. But at the elite level, the elected political level, there is a strategic aspect to introducing immigration into the conversation now.”

Two counties — liberal Alameda in the north and traditionally conservative San Diego in the south — highlight California’s internal divide over the law.And there are vastly different priorities within local law enforcement agencies: While line officers want ICE to keep its distance as they try to build trust within undocumented communities, corrections officers want a closer relationship with federal immigration agencies.

“You’re seeing that this pendulum in California went so far in one direction,” Hesselein said. “Now you are really starting to see that pendulum swing back, and we need to be somewhere in the middle because people are scared.”

When it comes to complying with competing federal and state requirements on immigration matters, we constantly have to second-guess ourselves, said Capt. Derrick Hesselein, commander of Santa Rita Jail in Dublin, Calif. (Salwan Georges/The Washington Post)

California: On its own with immigration

California has been breaking away from the federal government’s immigration policy for years.

The legislature passed the Trust Act five years ago to prohibit state and local agencies from complying with ICE immigration “holds,” notices to detain undocumented immigrants in local jails after they are eligible for release.

Then last year, after President Trump’s victory on a promise to build a wall along the southern border and step up deportations, the legislature voted to make California the nation’s first sanctuary state.

At the bill’s signing last fall, state Sen. Kevin de León (D-Los Angeles), who sponsored the legislation and is running for the U.S. Senate this year, said, “California’s local law enforcement cannot be commandeered and used by the Trump administration to tear families apart, undermine our safety and wreak havoc on our economy.”

But a recent survey conducted by the Haas Institute for a Fair and Inclusive Society at the University of California at Berkeley found that the state’s conflicting views on the issue endure: Nearly 2 in 3 respondents supported the principles of the sanctuary-state law, agreeing that local school, law enforcement and medical officials should limit contact with federal authorities. But 59 percent of all respondents also advocated an increase in deportations.

Under the law, county corrections officers can fulfill an ICE request for an undocumented inmate’s release date for two reasons: If the inmate has been convicted in the past 15 years of one of 31 serious crimes, or if probable cause has been found to support a pending charge for one of those crimes.

David Marin, director of the ICE field office in Los Angeles, said county corrections officers often err on the side of caution and deny ICE requests if there is uncertainty around the inmate’s legal status. Getting it wrong could mean a civil suit.

ICE agents, whom the law prohibits from having office space in county jails, may send corrections officers requests to speak to specific undocumented inmates. Once a request is received, corrections officers must deliver it to the inmate, who has a right to decline to speak to the ICE agent. Marin said inmates decline interviews “at least 95 percent of the time.”

“I know California politicians say they want to protect everyone with this law,” Marin said. “But what they are really doing is protecting the criminal alien.”

The civil rights concern driving many advocates of the law is whether, given the high number of documented and undocumented immigrants brought into the criminal justice system, those here illegally are being channeled toward ICE as a result of biased policing.

“There’s a connection — how do they get to jail here in the first place?” said Jon Rodney, spokesman for the California Immigrant Policy Center. “Race and class have a lot to do with who ends up there.”

Lester Chun, 63, walks his dog Mushu to a memorial grove at Lake Chabot Regional Park in Castro Valley, Calif. The memorial in Alameda County was built to commemorate children claimed by violence. (Salwan Georges/The Washington Post)

An election that changed everything

Alameda County borders the eastern shore of San Francisco Bay and stretches into rural valleys farther east. Now a majority-minority county, the population runs from mostly African American and white in and around Oakland to increasingly Latino outside the southern city limits.

In February, the Democratic mayor of Oakland, Libby Schaaf, announced publicly that ICE intended to conduct a series of immigration raids in the county. Celebrated locally, the announcement drew a sharp rebuke from the U.S. Justice Department, which threatened an investigation. Trump called the warning “a disgrace.”

ICE raids severely complicate the work of Alameda County sheriff’s deputies in places such as Ashland and Cherryland, adjacent neighborhoods south of Oakland where the majority of residents are undocumented.

Once supported economically by jobs in a now-shuttered Hunt’s cannery and a Pepsi bottling plant, the community has faded, first with the crack epidemic and then gang violence. The Little League teams and soccer clubs that sheriff’s Capt. Martin Neideffer recalls from his boyhood vanished with the jobs.

Now the crime rate is three times that of surrounding neighborhoods. An estimated 8,000 residents of the two neighborhoods, affecting nearly half of the households, have been in the criminal justice system. An estimated 60 percent of students in the school district, San Lorenzo Unified, come from Spanish-speaking homes.

But there is an obvious pride of place here with the small, red-tile roof homes neatly kept, their front lawns trimmed like golf greens.

In recent years, Neideffer has run a community-building initiative for the Sheriff’s Office in neighborhoods marked by a deep mistrust of authority.

Children play during a field day at Ashland Youth Center on April 3. The community south of Oakland has few jobs and a lot of crime. (Salwan Georges/The Washington Post)

Sgt. Oscar Perez of the Alameda County Sheriff's Office said his work to connect with communities of undocumented immigrants is undercut by fear of federal immigration agents. (Salwan Georges/The Washington Post)

LEFT: Children play during a field day at Ashland Youth Center on April 3. The community south of Oakland has few jobs and a lot of crime. RIGHT: Sgt. Oscar Perez of the Alameda County Sheriff's Office said his work to connect with communities of undocumented immigrants is undercut by fear of federal immigration agents. (Salwan Georges/The Washington Post)

The office has raised millions of dollars to establish clinical outreach programs, create soccer leagues and boxing tournaments, and build outdoor markets. There are Zumba classes, sponsored by the Sheriff’s Office, and a Spanish Academy, where deputies explain the dispatch and crime-reporting process.

Three of the office’s Explorers, members of a youth training program, are “dreamers” — undocumented immigrants who were brought to the country as children.

The goal is to create trust within the community so its members, particularly its most vulnerable, will report crime.

The chilling effect of the debate around the law has been noted on the ground. Deputies have seen a decline in attendance at the weekly community events they sponsor, and an analysis of crime reports in Ashland and Cherryland shows that the pace lags behind last year’s.

“The election of 2016 made all the difference in the world,” Neideffer said. “It has created a backlash and instability that has made the job that much harder.”

Juan Prieto, who works with young undocumented immigrants in Oakland, was 8 years old when his undocumented parents brought him to the Bay Area from the Mexican state of Baja California.

Late last month, his mother called to tell him she was worried about the smell of gas coming from her stove. It had been prevalent for days, but she was afraid to call the gas company, worried that, given the current political climate around immigration, the workers might ask for her residency papers.

“This is a day-to-day thing that has completely restructured the lives of the undocumented, this fear,” Prieto said. “And this campaign of fear goes two ways — to make people afraid of the undocumented and to make the undocumented fear being here.”

Children run during a soccer practice at a Deputy Sheriffs' Activities League field in San Leandro, Calif. (Salwan Georges/The Washington Post)

The Deputy Sheriffs' Activities League provides opportunities for Alameda County children to play soccer and other sports. (Salwan Georges/The Washington Post)

Children watch another team at a Deputy Sheriffs' Activities League soccer field in San Leandro, Calif. (Salwan Georges/The Washington Post)

The Deputy Sheriffs' Activities League provides opportunities for Alameda County children to play sports at facilities like this one in San Leandro. (Salwan Georges/The Washington Post)

Sgt. Oscar Perez patrols in an unmarked SUV, hoping to present a less-intimidating profile as he drives the Ashland and Cherryland streets. His mother came here from the Mexican state of Michoacan without the proper immigration documents; she has since become a citizen, and her son has been a deputy sheriff for 17 years.

His passion is the boxing gym that he helped build to offer kids some distraction and discipline. There are the ring, the heavy bags, the weights and the Latino kids outside skipping rope in the twilight.

Desks also sit along a second-story row of lockers where students who do not maintain a satisfactory grade-point average must do homework.

“ICE does its thing, and we do ours,” Perez said. “This is the way we try to build trust, a way they can really know us.”

Challenging the state

Los Alamitos is a city of 11,000 people, just an off-ramp amid the landscape of highways, power stanchions, strip malls and Denny’s restaurants just south of the Los Angeles County line. It is an unlikely cradle for a rebellion over immigration.

There is no jail here. The tiny police department does not enforce immigration policy. Yet on March 19, the City Council declared its intention to not follow the sanctuary-state law.

Other cities and the Orange County Board of Supervisors followed in the same spirit soon after by joining the Trump lawsuit. So too did San Diego County, the political home of former governor Pete Wilson (R), who in 1994 rode his endorsement of Proposition 187 to reelection.

By a wide margin, state voters approved the proposition, which denied undocumented immigrants access to most government services, including all but emergency public health care. The measure, which emerged from Orange County, passed with the endorsement of high-level Republican candidates, who benefited from supporting an initiative later found to be broadly unconstitutional.

Only two Republicans have won statewide races in California since Proposition 187 passed — an era in which Latinos have formed an increasing share of the electorate.

The political fight over the sanctuary-state law is playing out now across at least four congressional districts that Democrats have a chance to flip in Orange County, which favored a Democratic presidential candidate two years ago for the first time since the Great Depression.

On a recent evening, in a small courtyard of the small Los Alamitos City Hall, the debate over the law unfolded in a kind of election-year caricature. The council was set to pass an ordinance confirming that it would no longer abide by the California Values Act. Demonstrators gathered hours before.

“I’m just here to stand up for our laws, for law and order in our country,” said Jake Wall, a 20-year-old business major at the University of Southern California.

Wall, who grew up in Los Alamitos, waved a “Trump: Make America Great Again” flag at cars passing on Katella Avenue. He wore a matching T-shirt.

“We need to let ICE do its job,” he said. “And I say to immigrants, ‘Come here, come here, but do it legally.’ ”

An elderly white man, who declined to speak to “The Washington Compost,” carried a “Build wall, deport them all” sign. Other opponents of the law wore T-shirts bearing the faces of people they said were killed by undocumented immigrants.

Jeanie Nguyen, 18, rallying in favor of the California Values Act, argues with Roslyn La Liberte, 64, outside Los Alamitos City Hall on April 16. The council passed an ordinance saying it would no longer comply with a state law that restricts cities' cooperation with federal immigration authorities. (Philip Cheung/For The Washington Post)

A vote on April 16 by the Los Alamitos City Council drew competing rallies. Some said the Orange County community was right to cooperate with U.S. Immigration and Customs Enforcement, while others saw racism behind the vote. (Philip Cheung/For The Washington Post)

A man shows his support for President Trump's immigration policies outside Los Alamitos City Hall on April 16. Others wore T-shirts bearing the faces of people they said were killed by undocumented immigrants. (Philip Cheung/For The Washington Post)

Supporters and opponents of the California Values Act rally and debate outside Los Alamitos City Hall on April 16. The city council passed an ordinance saying it would no longer comply with a state law that restricts cities' cooperation with federal immigration authorities. (Philip Cheung/For The Washington Post)

The law’s supporters were equally vocal and more numerous. “De-colonize Orange County,” one sign read. “Refugees In, Racists Out,” read another. A cumbia band played, as the two sides yelled at and filmed each other.

Inside the hearing room, after hours of testimony, the council passed the ordinance despite objections from one member who said it was only a symbolic move that opens the city to litigation. Within 48 hours, a group of city residents filed suit, claiming the measure is illegal.

So far this year, Orange County corrections officers have complied with 181 ICE requests for information on the release dates of undocumented inmates. Undersheriff Don Barnes said 244 other requests did not meet the law’s criteria — even though, he said, some of those inmates are facing what he considers serious charges or were previously convicted of one.

“In California now, cooperation, not illegal immigration, is the sin,” said Orange County Supervisor Shawn Nelson, who introduced the measure to join the federal lawsuit against the state. “And we cannot accept that.”

Nelson, 51, was raised in Orange County. He is running as a Republican for the congressional seat left vacant with the retirement of Rep. Edward R. Royce, a 13-term Republican from Fullerton, where the city council recently decided not to take a position on the sanctuary-state lawsuit.

Six other Republicans — and six Democrats — also are seeking the seat, which both parties believe is important in deciding control of the House. Nelson’s campaign website pledges his support for the southern border wall and states, “I continue to support an America of immigrants but we cannot have lawlessness.”

There is no obvious mention of Trump.

People chat outside after the Alameda County Sheriffs Office academy for Spanish speakers last month in Hayward, Calif. Deputies use the forum to explain the crime-reporting process to residents, many of whom are undocumented immigrants. (Salwan Georges/The Washington Post)