ICE agents managed to interview an inmate in a San Francisco jail earlier this month, in what the sanctuary city's sheriff is calling a deliberate effort by the feds to find "weak points" in her department's pro-illegal immigrant policies and state laws.

In a separate snafu, police said, ICE agents were granted an interview room with an inmate in another jail, but that inmate declined to speak with the agents.

Jail officials apparently violated both departmental policy and California law by accomodating the agents, authorities said Monday.

“My staff made a mistake and I have to hold myself accountable,” San Francisco Sheriff Vicki Hennessy told The San Francisco Chronicle. “I apologize on behalf of the department. I feel embarrassed by it. I’ve taken steps to make sure it never happens again.”

But Hennessy said federal immigration authorities, who arrested 232 in a sweeping Bay Area immigration crackdown just weeks ago, knew what they were doing.

SESSIONS BLASTS 'RADICAL' MOVE BY CALIFORNIA TO BLOCK ICE RAIDS

ICE was "testing our defenses and they found some weak points," Hennessy told the Chronicle.

California state law mandates that inmates receive a consent form prior to interviewing with ICE agents, and San Francisco police policy goes a step further by banning ICE agents from having any access to inmates, the paper reported.

"I feel embarrassed by it. I've taken steps to make sure it never happens again." — SF Sheriff Vicki Hennessy

Officials reportedly did not provide a consent form to the inmate they managed to interview.

“How sheriff’s deputies are not aware of our sanctuary policies is quite frankly beyond me,” city public defender Jeff Adachi told the Chronicle.

Jail officials reportedly turned the ICE agents away when they attempted to return, according to local reports.

News of the jailhouse episode comes amid a bitter legal and political feud between California and the federal government over immigration policy.

On more than 200 occassions already this year, ICE has requested that California hold or surrender illegal immigrant inmates, the Chronicle reported. The state has not acted on any of these requests.

Last week, the Justice Department announced it is suing California for impermissibly interfering with federal immigration authority, in violation of the Constitution's Supremacy Clause.

“California is using every power it has, and some it does not, to frustrate federal law enforcement,” Attorney General Jeff Sessions said. “So you can be sure I’m going to use every power I have to stop them.”