The San Francisco spokesman for U.S. Immigration and Customs Enforcement resigned after the agency’s recent Northern California sweep, saying he couldn’t continue to do his job after Trump administration officials made false public statements about a key aspect of the operation.

James Schwab told The Chronicle on Monday that he was frustrated by repeated statements by officials, including U.S. Attorney General Jeff Sessions, that roughly 800 undocumented immigrants escaped arrest because of Oakland Mayor Libby Schaaf’s Feb. 24 warning to the public about the four-day operation, issued the night before federal officers began staking out homes and knocking on doors.

Schwab wanted the agency to correct the number, which he understood to be far lower, and didn’t want to deflect media questions about it, he said.

“I quit because I didn’t want to perpetuate misleading facts,” said Schwab, 38, who was hired in 2015 and resigned last week. “I asked them to change the information. I told them that the information was wrong, they asked me to deflect, and I didn’t agree with that. Then I took some time and I quit.”

Schwab said the statements about immigrants evading arrest, which were widely quoted in an array of media outlets, were misleading “because we were not ever going to be able to capture 100 percent of the target list” of roughly 1,000 undocumented immigrants in Northern California.

“I didn’t feel like fabricating the truth to defend ourselves against (Schaaf’s) actions was the way to go about it,” he said. “We were never going to pick up that many people. To say that 100 percent are dangerous criminals on the street, or that those people weren’t picked up because of the misguided actions of the mayor, is just wrong.”

ICE officials confirmed Schwab’s resignation, saying Monday that he “recently announced his departure” from the office of public affairs, but they would not discuss specifics, citing the confidentiality of personnel matters.

Schaaf praised Schwab’s action. “I commend Mr. Schwab for speaking the truth while under intense pressure to lie,” she said. “Our democracy depends on public servants who act with integrity and hold transparency in the highest regard.”

Asked about the disputed figures, an ICE spokeswoman in Washington, D.C., Jennifer Elzea, did not respond directly in an email. But she suggested that 800 immigrants had not evaded arrest because of Schaaf’s warning.

She referred to a quote from the head of ICE, Thomas Homan, who on the third day of the operation said, “864 criminal aliens and public safety threats remain at large in the community, and I have to believe that some of them were able to elude us thanks to the mayor’s irresponsible decision.”

The ICE operation, called Keep Safe, began Feb. 25 and was intended to send a message to California leaders that they could not shield immigrants from federal law despite state and local sanctuary policies. ICE reported arresting 232 undocumented immigrants in regions from the Central Valley to the northern reaches of the state.

On the night of Feb. 24, Schaaf announced that the sweep was imminent, saying she had learned about the operation from confidential sources and felt compelled to alert the community. The Trump administration was furious, saying the warning harmed the operation and endangered ICE officers in the field.

But officials’ statements about the consequences of the warning have shifted. After Homan said, “I have to believe that some of them were able to elude us,” he went further, saying on Feb. 28, “There’s 800 that we are unable to locate because of that warning, so that community is a lot less safe than it would have been.”

Sessions, speaking in Sacramento on Wednesday, said he had learned from Homan that “ICE failed to make 800 arrests that they would have made if the mayor had not acted as she did. Those are 800 wanted aliens that are now at large in that community.”

A day later, President Trump said ICE had been prepared to arrest “close to 1,000 people” before Schaaf’s warning.

That same day, Homan said in an appearance on Fox News that “many criminal aliens were not apprehended because of that warning. I can’t put a specific number on it.”

Schwab said that as a public face of the government, he found himself in an untenable situation.

“It’s the job of a public affairs officer to offer transparency for the agency you work for. I felt like we weren’t doing that,” he said. “I’ve never been in a situation when I’ve been asked to ignore the facts because it was more convenient. It was my first time being asked to do that.”