One of the central features of the statewide sanctuary law that has pitted California against the Trump administration is that it seeks to put limits on when local jails may turn over undocumented immigrants to federal deportation officers.

But Marin County Sheriff Robert Doyle, one of the 58 county sheriffs charged with enforcing SB54, provides no sanctuary to inmates in his lockup — and apparently doesn’t have to, thanks to an exception in the law.

If U.S. Immigration and Customs Enforcement tells Marin County it wants to take custody of an inmate and requests the person’s release date, Doyle’s deputies comply if such a date exists. And if ICE officers show up to the San Rafael jail to take the inmate, they are brought to a private area for the transfer.

Doyle believes this approach avoids potential disturbances between ICE and those waiting for an inmate in the main lobby.

“A lot of people think SB54 makes us a sanctuary state. It doesn’t, at all,” Doyle said in an interview.

Justice by geography has long been a feature in a diverse state where counties differ in how they deal with everything from drug crimes to the death penalty. Now, sanctuary is getting the California treatment, despite the law that went into effect this year — and to the chagrin of immigrants and their advocates.

There are few circumstances in which an undocumented immigrant jailed in San Francisco will be turned over to ICE, thanks to local laws that go much further than SB54, which was written by state Sen. Kevin de León, D-Los Angeles, and signed by Gov. Jerry Brown last year. But head north over the Golden Gate Bridge, and the feds can pick up anyone they want, provided the inmate has a release date.

Marin County may seem an unusual place for such cooperation. While some officials have rebelled against the sanctuary law in conservative parts of the Central Valley and Southern California, Doyle presides over a liberal county in a region known for progressive views on immigration.

This month, the Marin County Board of Supervisors voted to join in defending the state’s sanctuary legislation from a Trump administration lawsuit.

Doyle, though, hopes the legislation is repealed, explaining, “Unfortunately, a lot of laws are made for political reasons, and this is one of them.”

Dennis Rodoni, a Marin County supervisor, said the board and the sheriff aren’t seeing eye to eye on the issue. “We obviously disagree with what the sheriff believes in,” he said.

Proponents of limiting local cooperation with immigration enforcement say such measures allow all people — regardless of status — to engage with public services, including police protection, education and health care, rather than live in the shadows.

Critics say sanctuary laws encourage illegal immigration and, in freeing inmates who might otherwise be deported, can prove dangerous.

Jails are critical in the debate. While ICE operations on the street tend to command attention, the agency prefers to focus deportation efforts on local jails, where officers can pick up inmates without being forced to use more resources to make arrests in the field.

“Having advance notice of a criminal alien’s release from detention is exceptionally important to ICE’s ability to enforce immigration laws,” ICE Deputy Director Thomas Homan said in a declaration supporting the administration’s lawsuit against California.

When a person is arrested in California, fingerprints are compared with prints in federal databases that alert immigration authorities if the person is wanted. Last year, ICE issued 35,000 notification requests to jails in the state — about a quarter of the requests nationwide.

The county-by-county difference in responding to the statewide sanctuary law can be explained by language in the bill.

In general, county jails are allowed to respond to an ICE request for notification of an inmate’s release date only if the individual has been convicted of a serious crime or is headed to trial on such a charge. Many counties, including in the Bay Area, have set up complicated flowcharts describing when deputies can respond.

But Sheriff Doyle’s office points to a carve-out in the law: Counties can notify ICE about an inmate if the county makes the same information “available to the public.”

From the beginning of the year to May 1, ICE has asked for notification on 61 immigrant inmates in Marin County, and Doyle’s office has responded with release dates for all but six of them — or 90 percent of the requests, records show. Officials would not say how many inmates were actually picked up.

That’s a higher rate than nearby Alameda County, which said it had complied with 59 of 204 notification requests, 29 percent, as of early May. Conservative San Diego County said it had replied to 256 of 603 ICE requests, 42 percent, as of May 14.

In San Francisco, ICE has made more than 400 requests this year. None has been honored.

Pratheepan Gulasekaram, a professor and immigration expert at Santa Clara University School of Law, said that what Marin County is doing does not appear to be illegal or prohibited under the sanctuary law, otherwise known as the California Values Act.

“On the other hand, it is the type of disclosure that SB54 intended to, at the very least, disincentivize, and, at best, stop,” he said. “The pipeline through local sheriffs is the easiest way for ICE to get noncitizens into custody, so there is no doubt that the Marin sheriff’s actions run counter to the motivating ideas behind the state law.”

Doyle, who has been sheriff for more than 20 years after rising through his department’s ranks — and notes he didn’t vote for President Trump — said his approach helps protect the public.

“I just think as a general rule if you violate the law and you get arrested, you ought to be scrutinized by ICE,” he said. “That’s always been our policy.”

Jeremy Carl, a research fellow at Stanford University’s Hoover Institution, agreed, saying that if “Marin wants to try to be a bit less on the wrong side of the law, that is probably smart of them.”

Immigrant advocates in Marin County, though, say the sheriff’s office is working with ICE in ways it shouldn’t.

Marin County has 16,000 undocumented immigrants, according to its records — 6 percent of the population — and advocates fear that cooperation between local law enforcement and ICE will persuade many people not to come forward if they need police help or witnessed a crime.

“The sheriff’s willingness to continuing cooperating in these ways with ICE means that the jail-to-deportation pipeline is the primary means of detention by immigration officials in Marin County,” said Lucia Martel-Dow, director of immigration legal services at Canal Alliance, an advocacy group in San Rafael named after the heavily Latino Canal neighborhood in that city.

Advocates have paid close attention to counties that began posting inmates’ release dates on their websites this year, including Orange, Contra Costa, Alameda and Marin. While Contra Costa, Alameda and Marin officials said the move had nothing to do with immigration, Orange County officials said they put the release dates online to help ICE.

Grisel Ruiz, an attorney with the Immigrant Legal Resource Center in San Francisco, said advocates have shifted their focus from getting the sanctuary law passed and signed to making sure it’s enforced appropriately.

“It’s interesting — you work so hard to pass these laws, and then the application of the law is a whole other challenge,” Ruiz said.

Hamed Aleaziz is a San Francisco Chronicle staff writer. Email: haleaziz@sfchronicle.com Twitter: @haleaziz