Deputies are not supposed to work with ICE agents under the city's sanctuary laws.

San Francisco Public Defender Jeff Adachi says his office immediately stepped in to investigate once he learned federal immigration agents were inside the jails.

"One of my attorneys talked to a deputy as the ICE agents were walking into the jail and he said, 'Why are you letting them in?' and he said, 'We let them in like any other law enforcement agency," Adachi said.

Sheriff Vicki Hennessy says she's taken immediate action to make sure this does not happen again.

She issued a written statement taking full responsibility for what she admits was a mistake.

In part it read: "Any policy breach is a serious matter, especially as it pertains to the department's obligation to upholding the city's sanctuary committment."